mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
get rid of dead code, some new functions constify variables.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1041 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
567e0d583f
commit
d6665cba42
58
ChangeLog
58
ChangeLog
@ -1,3 +1,61 @@
|
||||
2000-09-26 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* src/support/unlink.C src/support/remove.C src/support/mkdir.C:
|
||||
new files use the everwhere possible.
|
||||
|
||||
* several files:
|
||||
* src/form1.C src/form1.h src/layout_forms.C src/layout_forms.h
|
||||
src/log_form.C src/lyx.C:
|
||||
regenerated
|
||||
|
||||
* src/buffer.C (runLaTeX): remove func
|
||||
|
||||
* src/PaperLayout.C: removed file
|
||||
* src/ParagraphExtra.C: likewise
|
||||
* src/bullet_forms.C: likewise
|
||||
* src/bullet_forms.h: likewise
|
||||
* src/bullet_forms_cb.C: likewise
|
||||
|
||||
* src/Makefile.am (lyx_SOURCES): remove PaperLayout.C,
|
||||
ParagraphExtra.C, bullet_forms.C, bullet_forms.h and
|
||||
bullet_forms_cb.C
|
||||
|
||||
* several files: remove all traces of the old fd_form_paragraph,
|
||||
and functions belonging to that.
|
||||
|
||||
* several files: remove all traces of the old fd_form_document,
|
||||
and functions belonging to that.
|
||||
|
||||
* several files: constify local variables were possible.
|
||||
|
||||
* several files: remove all code that was dead when NEW_EXPORT was
|
||||
defined
|
||||
|
||||
* several files: removed string::c_str in as many places as
|
||||
possible.
|
||||
|
||||
* forms/makefile (SRCS,OBJS,COBJS): removed bullet_forms.[fd,c,C]
|
||||
(e): be a bit more outspoken when patching
|
||||
(updatesrc): only move files if changed.
|
||||
|
||||
* forms/layout_forms.h.patch: regenerated
|
||||
|
||||
* forms/layout_forms.fd: remove form_document and form_paragraph
|
||||
and form_quotes and form_paper and form_table_options and
|
||||
form_paragraph_extra
|
||||
|
||||
* forms/form1.fd: remove form_table
|
||||
|
||||
* forms/fdfix.sh: remove sed rules for fl_set_object_lcolor and
|
||||
the fdui->... rewrite. Update some comments to xforms 0.88
|
||||
|
||||
* forms/bullet_forms.C.patch: removed file
|
||||
* forms/bullet_forms.fd: likewise
|
||||
* forms/bullet_forms.h.patch: likewise
|
||||
|
||||
* development/Code_rules/Rules: added a section on switch
|
||||
statements. Updated some comment to xforms 0.88.
|
||||
|
||||
2000-09-26 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* src/buffer.C (readFile): make sure that the whole version number
|
||||
|
@ -114,6 +114,20 @@ in C++.
|
||||
-NOT-
|
||||
T add(...);
|
||||
|
||||
- Avoid using the default cases in switch statements unless you have
|
||||
too. Use the correct type for the switch expression and let the
|
||||
compiler ensure that all cases are exhausted.
|
||||
|
||||
enum Foo {
|
||||
foo,
|
||||
bar
|
||||
};
|
||||
Foo f = ...;
|
||||
switch (f) {
|
||||
case foo: ...; break;
|
||||
case bar: ...; break;
|
||||
default: ...; break; // not needed and would shadow a wrong use of Foo
|
||||
}
|
||||
|
||||
Exceptions
|
||||
----------
|
||||
@ -318,7 +332,7 @@ Formatting
|
||||
* Using external GUI constructors (XForms fdesign)
|
||||
|
||||
- Fdesign generated files should not be changed at all. The only changes
|
||||
needed are gettext, compability with 0.81 or when you have made your own
|
||||
needed are gettext, compability with 0.88 or when you have made your own
|
||||
xforms objects and have just a dummy in the .fd file in place of your
|
||||
own. In case you have to change the generated files for any of the
|
||||
reasons above, you should provide a patch against the clean generated
|
||||
|
@ -1,45 +0,0 @@
|
||||
--- bullet_forms.c.orig Thu Aug 10 00:38:18 2000
|
||||
+++ bullet_forms.c Thu Aug 10 00:38:18 2000
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "forms.h"
|
||||
#include <stdlib.h>
|
||||
#include "bullet_forms.h"
|
||||
+#include "bmtable.h"
|
||||
+#include "support/filetools.h"
|
||||
|
||||
FD_form_bullet *create_form_form_bullet(void)
|
||||
{
|
||||
@@ -10,10 +12,21 @@
|
||||
FD_form_bullet *fdui = (FD_form_bullet *) fl_calloc(1, sizeof(*fdui));
|
||||
|
||||
fdui->form_bullet = fl_bgn_form(FL_NO_BOX, 370, 390);
|
||||
+ fl_set_border_width(-1);
|
||||
obj = fl_add_box(FL_UP_BOX,0,0,370,390,"");
|
||||
- fdui->replace_this_with_a_BMTable = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON,90,105,260,180,"");
|
||||
- fl_set_object_boxtype(obj,FL_NO_BOX);
|
||||
- fl_set_pixmapbutton_file(obj, "psnfss2.xpm");
|
||||
+
|
||||
+ // make the border thick again to improve the bmtable looks
|
||||
+ fl_set_border_width(-3);
|
||||
+
|
||||
+ fdui->bmtable_bullet_panel = obj = fl_add_bmtable(1, 90, 105, 265, 180, "");
|
||||
+ fl_set_object_callback(obj, BulletBMTableCB, 0);
|
||||
+ fl_set_object_lcol(obj, FL_BLUE);
|
||||
+ fl_set_object_boxtype(obj, FL_UP_BOX);
|
||||
+ fl_set_bmtable_pixmap_file(obj, 6, 6,
|
||||
+ LibFileSearch("images",
|
||||
+ "standard", "xpm").c_str());
|
||||
+
|
||||
+ fl_set_border_width(-1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME,95,20,255,70,"");
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME,0,340,370,50,"");
|
||||
fdui->choice_bullet_size = obj = fl_add_choice(FL_NORMAL_CHOICE,15,45,65,30,"Size|#z");
|
||||
@@ -33,6 +46,8 @@
|
||||
fdui->input_bullet_latex = obj = fl_add_input(FL_NORMAL_INPUT,80,300,275,30,"LaTeX|#L");
|
||||
fl_set_object_lsize(obj,FL_NORMAL_SIZE);
|
||||
fl_set_object_lstyle(obj,FL_FIXED_STYLE);
|
||||
+ fl_set_input_return(obj, FL_RETURN_CHANGED);
|
||||
+ fl_set_input_maxchars(obj, 80);
|
||||
fl_set_object_callback(obj,InputBulletLaTeXCB,0);
|
||||
|
||||
fdui->radio_bullet_depth = fl_bgn_group();
|
@ -1,452 +0,0 @@
|
||||
Magic: 13000
|
||||
|
||||
Internal Form Definition File
|
||||
(do not change)
|
||||
|
||||
Number of forms: 1
|
||||
Unit of measure: FL_COORD_PIXEL
|
||||
|
||||
=============== FORM ===============
|
||||
Name: form_bullet
|
||||
Width: 370
|
||||
Height: 390
|
||||
Number of Objects: 24
|
||||
|
||||
--------------------
|
||||
class: FL_BOX
|
||||
type: UP_BOX
|
||||
box: 0 0 370 390
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_PIXMAPBUTTON
|
||||
type: NORMAL_BUTTON
|
||||
box: 90 105 260 180
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_YELLOW
|
||||
alignment: FL_ALIGN_BOTTOM
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: replace_this_with_a_BMTable
|
||||
callback:
|
||||
argument:
|
||||
file: psnfss2.xpm
|
||||
fullpath: 1
|
||||
|
||||
--------------------
|
||||
class: FL_FRAME
|
||||
type: ENGRAVED_FRAME
|
||||
box: 95 20 255 70
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_BLACK FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_FRAME
|
||||
type: ENGRAVED_FRAME
|
||||
box: 0 340 370 50
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_BLACK FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_CHOICE
|
||||
type: NORMAL_CHOICE
|
||||
box: 15 45 65 30
|
||||
boxtype: FL_FRAME_BOX
|
||||
colors: FL_COL1 FL_BLACK
|
||||
alignment: FL_ALIGN_TOP
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Size|#z
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: choice_bullet_size
|
||||
callback: ChoiceBulletSizeCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RETURN_BUTTON
|
||||
box: 25 350 100 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: OK
|
||||
shortcut: ^M
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: button_ok
|
||||
callback: BulletOKCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: NORMAL_BUTTON
|
||||
box: 135 350 100 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Apply|#A
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: button_apply
|
||||
callback: BulletApplyCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: NORMAL_BUTTON
|
||||
box: 245 350 100 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Cancel|^[
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: button_cancel
|
||||
callback: BulletCancelCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_INPUT
|
||||
type: NORMAL_INPUT
|
||||
box: 80 300 275 30
|
||||
boxtype: FL_DOWN_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_LEFT
|
||||
style: FL_FIXED_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: LaTeX|#L
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: input_bullet_latex
|
||||
callback: InputBulletLaTeXCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_BEGIN_GROUP
|
||||
type: 0
|
||||
box: 0 0 0 0
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_depth
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 105 35 55 40
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_LARGE_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: 1|#1
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_depth_1
|
||||
callback: BulletDepthCB
|
||||
argument: 0
|
||||
value: 1
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 165 35 55 40
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_LARGE_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: 2|#2
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_depth_2
|
||||
callback: BulletDepthCB
|
||||
argument: 1
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 225 35 55 40
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_LARGE_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: 3|#3
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_depth_3
|
||||
callback: BulletDepthCB
|
||||
argument: 2
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 285 35 55 40
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_LARGE_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: 4|#4
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_depth_4
|
||||
callback: BulletDepthCB
|
||||
argument: 3
|
||||
|
||||
--------------------
|
||||
class: FL_END_GROUP
|
||||
type: 0
|
||||
box: 0 0 0 0
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_TEXT
|
||||
type: NORMAL_TEXT
|
||||
box: 105 10 85 20
|
||||
boxtype: FL_FLAT_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Bullet Depth
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_BEGIN_GROUP
|
||||
type: 0
|
||||
box: 0 0 0 0
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_panel
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 15 105 65 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Standard|#S
|
||||
shortcut:
|
||||
resize: FL_RESIZE_NONE
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_panel_standard
|
||||
callback: BulletPanelCB
|
||||
argument: 0
|
||||
value: 1
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 15 135 65 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Maths|#M
|
||||
shortcut:
|
||||
resize: FL_RESIZE_NONE
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_panel_maths
|
||||
callback: BulletPanelCB
|
||||
argument: 1
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 15 195 65 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Ding 2|#i
|
||||
shortcut:
|
||||
resize: FL_RESIZE_NONE
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_panel_ding2
|
||||
callback: BulletPanelCB
|
||||
argument: 3
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 15 225 65 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Ding 3|#n
|
||||
shortcut:
|
||||
resize: FL_RESIZE_NONE
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_panel_ding3
|
||||
callback: BulletPanelCB
|
||||
argument: 4
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 15 255 65 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Ding 4|#g
|
||||
shortcut:
|
||||
resize: FL_RESIZE_NONE
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_panel_ding4
|
||||
callback: BulletPanelCB
|
||||
argument: 5
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RADIO_BUTTON
|
||||
box: 15 165 65 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Ding 1|#D
|
||||
shortcut:
|
||||
resize: FL_RESIZE_NONE
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: radio_bullet_panel_ding1
|
||||
callback: BulletPanelCB
|
||||
argument: 2
|
||||
|
||||
--------------------
|
||||
class: FL_END_GROUP
|
||||
type: 0
|
||||
box: 0 0 0 0
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
==============================
|
||||
create_the_forms
|
@ -1,23 +0,0 @@
|
||||
--- bullet_forms.h Thu Dec 4 12:33:14 1997
|
||||
+++ ../src/bullet_forms.h Thu Dec 4 12:34:48 1997
|
||||
@@ -11,5 +11,11 @@
|
||||
extern void InputBulletLaTeXCB(FL_OBJECT *, long);
|
||||
extern void BulletDepthCB(FL_OBJECT *, long);
|
||||
extern void BulletPanelCB(FL_OBJECT *, long);
|
||||
+extern void BulletBMTableCB(FL_OBJECT *, long);
|
||||
+
|
||||
+
|
||||
+/**** Additional routines ****/
|
||||
|
||||
+extern void bulletForm();
|
||||
+extern bool updateBulletForm();
|
||||
|
||||
@@ -20,7 +39,7 @@
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
- FL_OBJECT *replace_this_with_a_BMTable;
|
||||
+ FL_OBJECT *bmtable_bullet_panel;
|
||||
FL_OBJECT *choice_bullet_size;
|
||||
FL_OBJECT *button_ok;
|
||||
FL_OBJECT *button_apply;
|
@ -24,7 +24,7 @@ if [ -f "$2.patch" ]; then
|
||||
patch -s $1 < "$2.patch"
|
||||
fi
|
||||
|
||||
echo "// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext" > $2
|
||||
echo "// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext" > $2
|
||||
echo "#include <config.h>" >> $2
|
||||
echo "#include \"lyx_gui_misc.h\"" >> $2
|
||||
echo "#include \"gettext.h\"" >> $2
|
||||
@ -56,16 +56,6 @@ echo >> $2
|
||||
# For all lines containing "fl_add" and a string containing |, add the
|
||||
# shortcut command after the end of this line
|
||||
#
|
||||
# -e 's/fl_set_object_lcolor/fl_set_object_lcol/'
|
||||
#
|
||||
# For all lines replace "fl_set_object_lcolor" with "fl_set_object_lcol"
|
||||
# This will be removed when we don't support 0.81
|
||||
#
|
||||
# -e 's/fdui->.*->fdui = fdui/\/\/&/'
|
||||
#
|
||||
# For all lines replace "fdui->...->fdui" with "//fdui->...->fdui"
|
||||
# This will be removed when we don't support 0.81
|
||||
#
|
||||
# -e 's/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/'
|
||||
#
|
||||
# Some picky/broken compilers (eg AIX's xlC) don't like evaluating
|
||||
@ -79,7 +69,9 @@ echo >> $2
|
||||
# Someone got busy and put spaces in after commas but didn't allow for the
|
||||
# autogeneration of the files so their pretty formatting got lost. Not anymore.
|
||||
# The second rule cleans up one special case where a comma appears at the end
|
||||
# of a string while ensuring "...", "..." isn't affected.
|
||||
# of a string while ensuring "...", "..." isn't affected. Update: this seems
|
||||
# to have not been fixed in fdesign 0.56 (xforms 0.89), we should probably
|
||||
# report it once more. (Lgb)
|
||||
#
|
||||
# -e 's/stdlib.h/cstdlib/'
|
||||
#
|
||||
@ -105,8 +97,6 @@ cat $1 | sed \
|
||||
-e '/shortcut/ s/".*[|].*"/scex(_(&))/' \
|
||||
-e '/fl_add/ s/".*[|].*"/idex(_(&))/' \
|
||||
-e '/fl_add/ s/idex(\(.*\)").*$/&fl_set_button_shortcut(obj,scex(\1")),1);/' \
|
||||
-e 's/fl_set_object_lcolor/fl_set_object_lcol/' \
|
||||
-e 's/fdui->.*->fdui = fdui/\/\/&/' \
|
||||
-e 's/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/' \
|
||||
-e 's/,\([^ ]\)/, \1/g' \
|
||||
-e 's/\("[^"][^"]*,\) \("\)/\1\2/g' \
|
||||
|
124
forms/form1.fd
124
forms/form1.fd
@ -3,7 +3,7 @@ Magic: 13000
|
||||
Internal Form Definition File
|
||||
(do not change)
|
||||
|
||||
Number of forms: 5
|
||||
Number of forms: 4
|
||||
Unit of measure: FL_COORD_PIXEL
|
||||
|
||||
=============== FORM ===============
|
||||
@ -249,7 +249,7 @@ argument:
|
||||
--------------------
|
||||
class: FL_BEGIN_GROUP
|
||||
type: 0
|
||||
box: 0 0 0 0
|
||||
box: 0 10 10 0
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -687,7 +687,7 @@ argument: 2
|
||||
--------------------
|
||||
class: FL_BEGIN_GROUP
|
||||
type: 0
|
||||
box: 0 0 0 0
|
||||
box: 0 10 10 0
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -867,7 +867,7 @@ argument:
|
||||
--------------------
|
||||
class: FL_BEGIN_GROUP
|
||||
type: 0
|
||||
box: 0 0 0 0
|
||||
box: 0 10 10 0
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -975,7 +975,7 @@ argument:
|
||||
--------------------
|
||||
class: FL_BEGIN_GROUP
|
||||
type: 0
|
||||
box: 0 0 0 0
|
||||
box: 0 10 10 0
|
||||
boxtype: FL_NO_BOX
|
||||
colors: FL_COL1 FL_MCOL
|
||||
alignment: FL_ALIGN_CENTER
|
||||
@ -1392,120 +1392,6 @@ name: timer
|
||||
callback:
|
||||
argument:
|
||||
|
||||
=============== FORM ===============
|
||||
Name: form_table
|
||||
Width: 310
|
||||
Height: 130
|
||||
Number of Objects: 6
|
||||
|
||||
--------------------
|
||||
class: FL_BOX
|
||||
type: UP_BOX
|
||||
box: 0 0 310 130
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_DEFAULT_SIZE
|
||||
lcol: FL_BLACK
|
||||
label:
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name:
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: RETURN_BUTTON
|
||||
box: 10 90 90 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: OK
|
||||
shortcut: ^M
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: button_ok
|
||||
callback: TableOKCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: NORMAL_BUTTON
|
||||
box: 110 90 90 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Apply|#A
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: button_apply
|
||||
callback: TableApplyCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_BUTTON
|
||||
type: NORMAL_BUTTON
|
||||
box: 210 90 90 30
|
||||
boxtype: FL_UP_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_CENTER
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Cancel|^[
|
||||
shortcut:
|
||||
resize: FL_RESIZE_ALL
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: button_cancel
|
||||
callback: TableCancelCB
|
||||
argument: 0
|
||||
|
||||
--------------------
|
||||
class: FL_VALSLIDER
|
||||
type: HOR_SLIDER
|
||||
box: 80 50 220 30
|
||||
boxtype: FL_DOWN_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_LEFT
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Columns
|
||||
shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: slider_columns
|
||||
callback:
|
||||
argument:
|
||||
|
||||
--------------------
|
||||
class: FL_VALSLIDER
|
||||
type: HOR_SLIDER
|
||||
box: 80 10 220 30
|
||||
boxtype: FL_DOWN_BOX
|
||||
colors: FL_COL1 FL_COL1
|
||||
alignment: FL_ALIGN_LEFT
|
||||
style: FL_NORMAL_STYLE
|
||||
size: FL_NORMAL_SIZE
|
||||
lcol: FL_BLACK
|
||||
label: Rows
|
||||
shortcut:
|
||||
resize: FL_RESIZE_X
|
||||
gravity: FL_NoGravity FL_NoGravity
|
||||
name: slider_rows
|
||||
callback:
|
||||
argument:
|
||||
|
||||
=============== FORM ===============
|
||||
Name: form_search
|
||||
Width: 440
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,49 +1,22 @@
|
||||
--- layout_forms.h.orig Sat Jun 10 01:48:56 2000
|
||||
+++ layout_forms.h Sat Jun 10 02:10:12 2000
|
||||
@@ -3,6 +3,8 @@
|
||||
#ifndef FD_form_document_h_
|
||||
#define FD_form_document_h_
|
||||
|
||||
+extern "C" {
|
||||
+
|
||||
/** Callbacks, globals and object handlers **/
|
||||
extern void ChoiceClassCB(FL_OBJECT *, long);
|
||||
extern void DocumentCancelCB(FL_OBJECT *, long);
|
||||
@@ -46,6 +48,29 @@
|
||||
extern void TableOptionsCB(FL_OBJECT *, long);
|
||||
extern void TableSpeCloseCB(FL_OBJECT *, long);
|
||||
|
||||
+}
|
||||
+
|
||||
+/* Additional Functions/Methods */
|
||||
+
|
||||
+#include "bufferparams.h"
|
||||
+
|
||||
+extern bool UpdateLayoutDocument(BufferParams *params = NULL);
|
||||
+extern bool UpdateLayoutPreamble();
|
||||
+extern bool UpdateLayoutPaper();
|
||||
+extern bool UpdateLayoutQuotes();
|
||||
+extern bool UpdateLayoutParagraph();
|
||||
+extern bool UpdateParagraphExtra();
|
||||
+extern bool UpdateLayoutTable(int);
|
||||
+
|
||||
+extern void MenuLayoutCharacter();
|
||||
+extern void MenuLayoutDocument();
|
||||
+extern void MenuLayoutPreamble();
|
||||
+extern void MenuLayoutPaper();
|
||||
+extern void MenuLayoutQuotes();
|
||||
+extern void MenuLayoutParagraph();
|
||||
+extern void MenuLayoutTable(int);
|
||||
+
|
||||
+extern "C" {
|
||||
|
||||
/**** Forms and Objects ****/
|
||||
typedef struct {
|
||||
@@ -255,5 +280,7 @@
|
||||
} FD_form_table_extra;
|
||||
|
||||
extern FD_form_table_extra * create_form_form_table_extra(void);
|
||||
+
|
||||
+}
|
||||
|
||||
#endif /* FD_form_document_h_ */
|
||||
1c1
|
||||
< /** Header file generated with fdesign on Tue Sep 26 15:14:15 2000.**/
|
||||
---
|
||||
> /** Header file generated with fdesign **/
|
||||
7,8c7,8
|
||||
< extern void CharacterApplyCB(FL_OBJECT *, long);
|
||||
< extern void CharacterCloseCB(FL_OBJECT *, long);
|
||||
---
|
||||
> extern "C" void CharacterApplyCB(FL_OBJECT *, long);
|
||||
> extern "C" void CharacterCloseCB(FL_OBJECT *, long);
|
||||
10,12c10,12
|
||||
< extern void PreambleOKCB(FL_OBJECT *, long);
|
||||
< extern void PreambleApplyCB(FL_OBJECT *, long);
|
||||
< extern void PreambleCancelCB(FL_OBJECT *, long);
|
||||
---
|
||||
> extern "C" void PreambleOKCB(FL_OBJECT *, long);
|
||||
> extern "C" void PreambleApplyCB(FL_OBJECT *, long);
|
||||
> extern "C" void PreambleCancelCB(FL_OBJECT *, long);
|
||||
13a14,16
|
||||
> /* Some extra funcs */
|
||||
>
|
||||
> extern bool UpdateLayoutPreamble();
|
||||
|
@ -17,15 +17,15 @@ SHELL = /bin/sh
|
||||
# Various commands
|
||||
FDESIGN = fdesign
|
||||
|
||||
SRCS = bullet_forms.fd credits_form.fd form1.fd \
|
||||
SRCS = credits_form.fd form1.fd \
|
||||
log_form.fd layout_forms.fd lyx.fd lyx_sendfax.fd math_forms.fd \
|
||||
print_form.fd sp_form.fd
|
||||
|
||||
OBJS = bullet_forms.c credits_form.c form1.c \
|
||||
OBJS = credits_form.c form1.c \
|
||||
log_form.c layout_forms.c lyx.c lyx_sendfax.c math_forms.c \
|
||||
print_form.c sp_form.c
|
||||
|
||||
COBJS = bullet_forms.C credits_form.C form1.C \
|
||||
COBJS = credits_form.C form1.C \
|
||||
log_form.C layout_forms.C lyx.C lyx_sendfax.C math_forms.C \
|
||||
print_form.C sp_form.C
|
||||
|
||||
@ -52,7 +52,7 @@ e: c
|
||||
for hfil in *.h ; do \
|
||||
if [ -f "$$hfil.patch" ] ; then \
|
||||
(echo "Patching $$hfil with $$hfil.patch" ; \
|
||||
patch -s $$hfil < $$hfil.patch) \
|
||||
patch --verbose $$hfil < $$hfil.patch) \
|
||||
fi; \
|
||||
sed < $$hfil > $$hfil.tmp \
|
||||
-e 's/\(extern\) \(void.*FL_OBJECT\)/\1 "C" \2/' \
|
||||
@ -68,9 +68,9 @@ updatesrc: d e
|
||||
@echo "get junk code and errors at compile time.">&2
|
||||
for fil in *.C *.h ; do \
|
||||
if [ $$fil = "math_forms.C" -o $$fil = "math_forms.h" ]; then \
|
||||
cp $$fil ../src/mathed ; \
|
||||
cmp -s $$fil ../src/mathed/$$fil || cp $$fil ../src/mathed ; \
|
||||
else \
|
||||
cp $$fil ../src ; \
|
||||
cmp -s $$fil ../src/$$fil || cp $$fil ../src ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
|
@ -14,8 +14,6 @@ src/bufferlist.C
|
||||
src/BufferView2.C
|
||||
src/bufferview_funcs.C
|
||||
src/BufferView_pimpl.C
|
||||
src/bullet_forms.C
|
||||
src/bullet_forms_cb.C
|
||||
src/Chktex.C
|
||||
src/ColorHandler.C
|
||||
src/combox.C
|
||||
@ -127,9 +125,7 @@ src/mathed/math_forms.C
|
||||
src/mathed/math_panel.C
|
||||
src/MenuBackend.C
|
||||
src/minibuffer.C
|
||||
src/PaperLayout.C
|
||||
src/paragraph.C
|
||||
src/ParagraphExtra.C
|
||||
src/print_form.C
|
||||
src/spellchecker.C
|
||||
src/sp_form.C
|
||||
|
@ -716,13 +716,13 @@ void BufferView::replaceWord(string const & replacestring)
|
||||
|
||||
/* clear the selection (if there is any) */
|
||||
toggleSelection(false);
|
||||
text->ReplaceSelectionWithString(this, replacestring.c_str());
|
||||
text->ReplaceSelectionWithString(this, replacestring);
|
||||
|
||||
text->SetSelectionOverString(this, replacestring.c_str());
|
||||
text->SetSelectionOverString(this, replacestring);
|
||||
|
||||
// Go back so that replacement string is also spellchecked
|
||||
for (string::size_type i = 0; i < replacestring.length() + 1; ++i) {
|
||||
text->CursorLeftIntern(this);
|
||||
text->CursorLeft(this);
|
||||
}
|
||||
update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <cstdlib> // atoi
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
@ -76,7 +75,7 @@ int Chktex::scanLogFile(TeXErrors & terr)
|
||||
token = split(token, warno, ':');
|
||||
token = split(token, warning, ':');
|
||||
|
||||
int lineno = atoi(line.c_str());
|
||||
int lineno = lyx::atoi(line);
|
||||
warno = _("ChkTeX warning id #") + warno;
|
||||
terr.insertError(lineno, warno, warning);
|
||||
++retval;
|
||||
|
@ -37,7 +37,7 @@ void DepTable::insert(string const & fi,
|
||||
if (deplist.find(f) == deplist.end()) {
|
||||
if (upd) {
|
||||
one = two;
|
||||
two = lyx::sum(f.c_str());
|
||||
two = lyx::sum(f);
|
||||
}
|
||||
deplist[f] = make_pair(one, two);
|
||||
}
|
||||
@ -49,8 +49,8 @@ void DepTable::update()
|
||||
for(DepList::iterator itr = deplist.begin();
|
||||
itr != deplist.end();
|
||||
++itr) {
|
||||
unsigned long one = (*itr).second.second;
|
||||
unsigned long two = lyx::sum((*itr).first.c_str());
|
||||
unsigned long const one = (*itr).second.second;
|
||||
unsigned long const two = lyx::sum((*itr).first);
|
||||
(*itr).second = make_pair(one, two);
|
||||
if (lyxerr.debugging(Debug::DEPEND)) {
|
||||
lyxerr << "Update dep: " << (*itr).first << " "
|
||||
@ -93,7 +93,7 @@ bool DepTable::extchanged(string const & ext) const
|
||||
for (DepList::const_iterator cit = deplist.begin();
|
||||
cit != deplist.end();
|
||||
++cit) {
|
||||
if (suffixIs((*cit).first, ext.c_str())) {
|
||||
if (suffixIs((*cit).first, ext)) {
|
||||
if ((*cit).second.first != (*cit).second.second)
|
||||
return true;
|
||||
}
|
||||
@ -115,7 +115,7 @@ void DepTable::remove_files_with_extension(string const & suf)
|
||||
DepList tmp;
|
||||
for (DepList::const_iterator cit = deplist.begin();
|
||||
cit != deplist.end(); ++cit) {
|
||||
if (!suffixIs((*cit).first, suf.c_str()))
|
||||
if (!suffixIs((*cit).first, suf))
|
||||
tmp[(*cit).first] = (*cit).second;
|
||||
}
|
||||
deplist.swap(tmp);
|
||||
@ -126,8 +126,7 @@ void DepTable::write(string const & f) const
|
||||
{
|
||||
ofstream ofs(f.c_str());
|
||||
for (DepList::const_iterator cit = deplist.begin();
|
||||
cit != deplist.end();
|
||||
++cit) {
|
||||
cit != deplist.end(); ++cit) {
|
||||
if (lyxerr.debugging(Debug::DEPEND)) {
|
||||
lyxerr << "Write dep: "
|
||||
<< (*cit).first << " "
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <cmath> // fabs()
|
||||
#include <cstdlib> // atoi()
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
|
||||
@ -131,7 +130,7 @@ void FontInfo::query()
|
||||
// We have matches. Run them through
|
||||
for(int i = 0; i < matches; ++i) {
|
||||
string name(list[i]);
|
||||
sizes[i] = atoi(token(name, '-', 7).c_str());
|
||||
sizes[i] = lyx::atoi(token(name, '-', 7));
|
||||
strings[i] = name;
|
||||
if (sizes[i] == 0) {
|
||||
if (scaleindex == -1) {
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <cmath> // fabs()
|
||||
#include <cstdlib> // atoi()
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "FontLoader.h"
|
||||
|
@ -83,7 +83,7 @@ void LaTeX::deleteFilesOnError() const
|
||||
// What files do we have to delete?
|
||||
|
||||
// This will at least make latex do all the runs
|
||||
::unlink(depfile.c_str());
|
||||
lyx::unlink(depfile);
|
||||
|
||||
// but the reason for the error might be in a generated file...
|
||||
|
||||
@ -91,15 +91,15 @@ void LaTeX::deleteFilesOnError() const
|
||||
|
||||
// bibtex file
|
||||
string bbl = ChangeExtension(ofname, ".bbl");
|
||||
::unlink(bbl.c_str());
|
||||
lyx::unlink(bbl);
|
||||
|
||||
// makeindex file
|
||||
string ind = ChangeExtension(ofname, ".ind");
|
||||
::unlink(ind.c_str());
|
||||
lyx::unlink(ind);
|
||||
|
||||
// Also remove the aux file
|
||||
string aux = ChangeExtension(ofname, ".aux");
|
||||
::unlink(aux.c_str());
|
||||
lyx::unlink(aux);
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,11 +22,6 @@
|
||||
// only to get access to NEW_INSETS
|
||||
#include "lyxparagraph.h"
|
||||
#endif
|
||||
#if 1
|
||||
// only to get access to NEW_EXPORT
|
||||
#include "exporter.h"
|
||||
#endif
|
||||
|
||||
|
||||
using std::ostream;
|
||||
using std::endl;
|
||||
@ -137,8 +132,6 @@ void LyXAction::init()
|
||||
#endif
|
||||
{ LFUN_IMPORT, "buffer-import",
|
||||
N_("Import document"), NoBuffer },
|
||||
{ LFUN_BUFFERBULLETSSELECT, "buffer-itemize-bullets-select",
|
||||
"", Noop },
|
||||
{ LFUN_BUFFER_PRINT, "buffer-print-xtl", N_("Print"),
|
||||
ReadOnly },
|
||||
{ LFUN_PRINTER_PARAMS_GET, "printer-params-get",
|
||||
@ -154,18 +147,8 @@ void LyXAction::init()
|
||||
N_("Switch to an open document"), ReadOnly },
|
||||
{ LFUN_READ_ONLY_TOGGLE, "buffer-toggle-read-only",
|
||||
N_("Toggle read-only"), ReadOnly },
|
||||
#ifdef NEW_EXPORT
|
||||
{ LFUN_UPDATE, "buffer-update", N_("Update"), ReadOnly },
|
||||
{ LFUN_PREVIEW, "buffer-view", N_("View") , ReadOnly },
|
||||
#else
|
||||
{ LFUN_RUNLATEX, "buffer-typeset", N_("Update DVI"),
|
||||
ReadOnly },
|
||||
{ LFUN_RUNDVIPS, "buffer-typeset-ps",
|
||||
N_("Update PostScript"), ReadOnly },
|
||||
{ LFUN_PREVIEW, "buffer-view", N_("View DVI") , ReadOnly },
|
||||
{ LFUN_PREVIEWPS, "buffer-view-ps",
|
||||
N_("View PostScript") , ReadOnly },
|
||||
#endif
|
||||
{ LFUN_MENUWRITE, "buffer-write", N_("Save"), ReadOnly },
|
||||
{ LFUN_MENUWRITEAS, "buffer-write-as", N_("Save As"),
|
||||
ReadOnly },
|
||||
@ -283,15 +266,11 @@ void LyXAction::init()
|
||||
{ LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly },
|
||||
{ LFUN_LAYOUTNO, "layout-number", "", Noop }, // internal only
|
||||
{ LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly },
|
||||
{ LFUN_LAYOUT_PAPER, "layout-paper", "", ReadOnly },
|
||||
{ LFUN_LAYOUT_PASTE, "layout-paste",
|
||||
N_("Paste paragraph environment type"), Noop },
|
||||
{ LFUN_LAYOUT_PREAMBLE, "layout-preamble", "", ReadOnly },
|
||||
{ LFUN_LAYOUT_QUOTES, "layout-quotes", "", ReadOnly },
|
||||
{ LFUN_LAYOUT_SAVE_DEFAULT, "layout-save-default", "",
|
||||
ReadOnly },
|
||||
{ LFUN_LAYOUT_TABLE, "layout-table",
|
||||
N_("Open the table layout"), Noop },
|
||||
{ LFUN_LAYOUT_TABULAR, "layout-tabular",
|
||||
N_("Open the tabular layout"), Noop },
|
||||
{ LFUN_HOME, "line-begin",
|
||||
@ -547,7 +526,6 @@ kb_action LyXAction::retrieveActionArg(int pseudo, string & arg) const
|
||||
lyxerr << "Lyx Error: Unrecognized pseudo-action\n";
|
||||
return LFUN_UNKNOWN_ACTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "support/syscall.h"
|
||||
#include "gettext.h"
|
||||
//#include "lyx_cb.h"
|
||||
#include "bufferview_funcs.h"
|
||||
#include "exporter.h"
|
||||
|
||||
@ -57,18 +56,6 @@ void SendtoApplyCB(FL_OBJECT *, long)
|
||||
if (command.empty())
|
||||
return;
|
||||
Buffer * buffer = current_view->buffer();
|
||||
#ifndef NEW_EXPORT
|
||||
if (fl_get_button(fd_form_sendto->radio_ftype_dvi) ||
|
||||
fl_get_button(fd_form_sendto->radio_ftype_ps)) {
|
||||
ProhibitInput(current_view);
|
||||
// Generate dvi file and check if there are errors in the .lyx file
|
||||
if (MakeLaTeXOutput(buffer) > 0) {
|
||||
AllowInput(current_view);
|
||||
return;
|
||||
}
|
||||
AllowInput(current_view);
|
||||
}
|
||||
#endif
|
||||
string ftypeext;
|
||||
if (fl_get_button(fd_form_sendto->radio_ftype_lyx))
|
||||
ftypeext = ".lyx";
|
||||
@ -79,20 +66,13 @@ void SendtoApplyCB(FL_OBJECT *, long)
|
||||
else if (fl_get_button(fd_form_sendto->radio_ftype_ascii))
|
||||
ftypeext = ".txt";
|
||||
else {
|
||||
#ifdef NEW_EXPORT
|
||||
ftypeext = ".ps";
|
||||
if (!Exporter::Export(buffer, "ps", true))
|
||||
return;
|
||||
#else
|
||||
ftypeext = ".ps_tmp";
|
||||
if (!CreatePostscript(buffer, true)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
string fname = OnlyFilename(ChangeExtension(buffer->getLatexName(),
|
||||
ftypeext));
|
||||
string const fname = OnlyFilename(ChangeExtension(buffer->getLatexName(),
|
||||
ftypeext));
|
||||
if (!contains(command, "$$FName"))
|
||||
command = "( " + command + " ) <$$FName";
|
||||
command = subst(command, "$$FName", fname);
|
||||
|
@ -40,8 +40,6 @@
|
||||
|
||||
using std::endl;
|
||||
|
||||
extern FD_form_document * fd_form_document;
|
||||
|
||||
extern void AutoSave(BufferView *);
|
||||
extern void QuitLyX();
|
||||
LyXTextClass::size_type current_layout = 0;
|
||||
@ -311,7 +309,6 @@ void LyXView::init()
|
||||
// Set the textclass choice
|
||||
invalidateLayoutChoice();
|
||||
updateLayoutChoice();
|
||||
UpdateDocumentClassChoice();
|
||||
updateMenubar();
|
||||
|
||||
// Start autosave timer
|
||||
@ -365,20 +362,6 @@ void LyXView::updateLayoutChoice()
|
||||
}
|
||||
|
||||
|
||||
void LyXView::UpdateDocumentClassChoice()
|
||||
{
|
||||
// Update the document class display in the document form
|
||||
if (fd_form_document) {
|
||||
fl_clear_choice(fd_form_document->choice_class);
|
||||
for (LyXTextClassList::const_iterator cit = textclasslist.begin();
|
||||
cit != textclasslist.end(); ++cit) {
|
||||
fl_addto_choice(fd_form_document->choice_class,
|
||||
(*cit).description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
// This is necessary, since FL_FREE-Objects doesn't get all keypress events
|
||||
// as FL_KEYBOARD events :-( Matthias 280596
|
||||
|
@ -131,10 +131,8 @@ private:
|
||||
BufferView * bufferview;
|
||||
///
|
||||
void invalidateLayoutChoice();
|
||||
///
|
||||
void UpdateDocumentClassChoice();
|
||||
public:
|
||||
#if FL_REVISION < 89
|
||||
#if 0
|
||||
///
|
||||
static int KeyPressMask_raw_callback(FL_FORM *, void * xev);
|
||||
#endif
|
||||
|
@ -69,8 +69,6 @@ lyx_SOURCES = \
|
||||
Painter.h \
|
||||
PainterBase.C \
|
||||
PainterBase.h \
|
||||
PaperLayout.C \
|
||||
ParagraphExtra.C \
|
||||
PrinterParams.h \
|
||||
Sectioning.h \
|
||||
Sectioning.C \
|
||||
@ -100,9 +98,6 @@ lyx_SOURCES = \
|
||||
bufferparams.h \
|
||||
bufferview_funcs.C \
|
||||
bufferview_funcs.h \
|
||||
bullet_forms.C \
|
||||
bullet_forms.h \
|
||||
bullet_forms_cb.C \
|
||||
chset.C \
|
||||
chset.h \
|
||||
combox.C \
|
||||
|
@ -116,7 +116,7 @@ Menu & Menu::read(LyXLex & lex)
|
||||
// fallback to md_item
|
||||
case md_item: {
|
||||
lex.next();
|
||||
char * tmp = strdup(lex.GetString().c_str());
|
||||
char * tmp = ::strdup(lex.GetString().c_str());
|
||||
string name = _(tmp);
|
||||
free(tmp);
|
||||
lex.next();
|
||||
@ -161,7 +161,7 @@ Menu & Menu::read(LyXLex & lex)
|
||||
|
||||
case md_submenu: {
|
||||
lex.next();
|
||||
char * tmp = strdup(lex.GetString().c_str());
|
||||
char * tmp = ::strdup(lex.GetString().c_str());
|
||||
string mlabel = _(tmp);
|
||||
free(tmp);
|
||||
lex.next();
|
||||
|
@ -1,282 +0,0 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
#include "layout_forms.h"
|
||||
#include "lyx_main.h"
|
||||
#include "lyxrc.h"
|
||||
#include "LString.h"
|
||||
#include "support/filetools.h"
|
||||
#include "buffer.h"
|
||||
#include "minibuffer.h"
|
||||
#include "vspace.h"
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "BufferView.h"
|
||||
#include "gettext.h"
|
||||
#include "LyXView.h"
|
||||
|
||||
extern FD_form_paper * fd_form_paper;
|
||||
extern BufferView * current_view;
|
||||
|
||||
|
||||
inline
|
||||
void DeactivatePaperButtons ()
|
||||
{
|
||||
fl_deactivate_object (fd_form_paper->button_ok);
|
||||
fl_deactivate_object (fd_form_paper->button_apply);
|
||||
fl_set_object_lcol (fd_form_paper->button_ok, FL_INACTIVE);
|
||||
fl_set_object_lcol (fd_form_paper->button_apply, FL_INACTIVE);
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void ActivatePaperButtons ()
|
||||
{
|
||||
fl_activate_object (fd_form_paper->button_ok);
|
||||
fl_activate_object (fd_form_paper->button_apply);
|
||||
fl_set_object_lcol (fd_form_paper->button_ok, FL_BLACK);
|
||||
fl_set_object_lcol (fd_form_paper->button_apply, FL_BLACK);
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void DisablePaperLayout()
|
||||
{
|
||||
DeactivatePaperButtons();
|
||||
fl_deactivate_object (fd_form_paper->choice_paperpackage);
|
||||
fl_deactivate_object (fd_form_paper->greoup_radio_orientation);
|
||||
fl_deactivate_object (fd_form_paper->radio_portrait);
|
||||
fl_deactivate_object (fd_form_paper->radio_landscape);
|
||||
fl_deactivate_object (fd_form_paper->choice_papersize2);
|
||||
fl_deactivate_object (fd_form_paper->push_use_geometry);
|
||||
fl_deactivate_object (fd_form_paper->input_custom_width);
|
||||
fl_deactivate_object (fd_form_paper->input_custom_height);
|
||||
fl_deactivate_object (fd_form_paper->input_top_margin);
|
||||
fl_deactivate_object (fd_form_paper->input_bottom_margin);
|
||||
fl_deactivate_object (fd_form_paper->input_left_margin);
|
||||
fl_deactivate_object (fd_form_paper->input_right_margin);
|
||||
fl_deactivate_object (fd_form_paper->input_head_height);
|
||||
fl_deactivate_object (fd_form_paper->input_head_sep);
|
||||
fl_deactivate_object (fd_form_paper->input_foot_skip);
|
||||
fl_deactivate_object (fd_form_paper->text_warning);
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void EnablePaperLayout()
|
||||
{
|
||||
ActivatePaperButtons();
|
||||
fl_activate_object (fd_form_paper->choice_paperpackage);
|
||||
fl_activate_object (fd_form_paper->greoup_radio_orientation);
|
||||
fl_activate_object (fd_form_paper->radio_portrait);
|
||||
fl_activate_object (fd_form_paper->radio_landscape);
|
||||
fl_activate_object (fd_form_paper->choice_papersize2);
|
||||
fl_activate_object (fd_form_paper->push_use_geometry);
|
||||
fl_activate_object (fd_form_paper->input_custom_width);
|
||||
fl_activate_object (fd_form_paper->input_custom_height);
|
||||
fl_activate_object (fd_form_paper->input_top_margin);
|
||||
fl_activate_object (fd_form_paper->input_bottom_margin);
|
||||
fl_activate_object (fd_form_paper->input_left_margin);
|
||||
fl_activate_object (fd_form_paper->input_right_margin);
|
||||
fl_activate_object (fd_form_paper->input_head_height);
|
||||
fl_activate_object (fd_form_paper->input_head_sep);
|
||||
fl_activate_object (fd_form_paper->input_foot_skip);
|
||||
fl_activate_object (fd_form_paper->text_warning);
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
void checkMarginValues()
|
||||
{
|
||||
int allEmpty;
|
||||
|
||||
fl_hide_object(fd_form_paper->text_warning);
|
||||
ActivatePaperButtons();
|
||||
|
||||
allEmpty = (!strlen(fl_get_input(fd_form_paper->input_top_margin)) &&
|
||||
!strlen(fl_get_input(fd_form_paper->input_bottom_margin)) &&
|
||||
!strlen(fl_get_input(fd_form_paper->input_left_margin)) &&
|
||||
!strlen(fl_get_input(fd_form_paper->input_right_margin)) &&
|
||||
!strlen(fl_get_input(fd_form_paper->input_head_height)) &&
|
||||
!strlen(fl_get_input(fd_form_paper->input_head_sep)) &&
|
||||
!strlen(fl_get_input(fd_form_paper->input_foot_skip)) &&
|
||||
!strlen(fl_get_input(fd_form_paper->input_custom_width)) &&
|
||||
!strlen(fl_get_input(fd_form_paper->input_custom_height)));
|
||||
if (!allEmpty) {
|
||||
fl_set_button(fd_form_paper->push_use_geometry, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool UpdateLayoutPaper()
|
||||
{
|
||||
bool update = true;
|
||||
if (!current_view->available())
|
||||
update = false;
|
||||
|
||||
if (update) {
|
||||
BufferParams * params = ¤t_view->buffer()->params;
|
||||
|
||||
fl_set_choice(fd_form_paper->choice_papersize2,
|
||||
params->papersize2 + 1);
|
||||
fl_set_choice(fd_form_paper->choice_paperpackage,
|
||||
params->paperpackage + 1);
|
||||
fl_set_button(fd_form_paper->push_use_geometry,
|
||||
params->use_geometry);
|
||||
fl_set_button(fd_form_paper->radio_portrait, 0);
|
||||
fl_set_button(fd_form_paper->radio_landscape, 0);
|
||||
if (params->orientation == BufferParams::ORIENTATION_LANDSCAPE)
|
||||
fl_set_button(fd_form_paper->radio_landscape, 1);
|
||||
else
|
||||
fl_set_button(fd_form_paper->radio_portrait, 1);
|
||||
|
||||
fl_set_input(fd_form_paper->input_custom_width,
|
||||
params->paperwidth.c_str());
|
||||
fl_set_input(fd_form_paper->input_custom_height,
|
||||
params->paperheight.c_str());
|
||||
fl_set_input(fd_form_paper->input_left_margin,
|
||||
params->leftmargin.c_str());
|
||||
fl_set_input(fd_form_paper->input_top_margin,
|
||||
params->topmargin.c_str());
|
||||
fl_set_input(fd_form_paper->input_right_margin,
|
||||
params->rightmargin.c_str());
|
||||
fl_set_input(fd_form_paper->input_bottom_margin,
|
||||
params->bottommargin.c_str());
|
||||
fl_set_input(fd_form_paper->input_head_height,
|
||||
params->headheight.c_str());
|
||||
fl_set_input(fd_form_paper->input_head_sep,
|
||||
params->headsep.c_str());
|
||||
fl_set_input(fd_form_paper->input_foot_skip,
|
||||
params->footskip.c_str());
|
||||
fl_set_focus_object(fd_form_paper->form_paper,
|
||||
fd_form_paper->choice_papersize2);
|
||||
fl_hide_object(fd_form_paper->text_warning);
|
||||
if (current_view->buffer()->isReadonly()) {
|
||||
DisablePaperLayout();
|
||||
fl_set_object_label(fd_form_paper->text_warning,
|
||||
_("Document is read-only."
|
||||
" No changes to layout"
|
||||
" permitted."));
|
||||
fl_show_object(fd_form_paper->text_warning);
|
||||
} else {
|
||||
EnablePaperLayout();
|
||||
}
|
||||
} else if (fd_form_paper->form_paper->visible) {
|
||||
fl_hide_form(fd_form_paper->form_paper);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
|
||||
void MenuLayoutPaper()
|
||||
{
|
||||
if (UpdateLayoutPaper()) {
|
||||
if (fd_form_paper->form_paper->visible) {
|
||||
fl_raise_form(fd_form_paper->form_paper);
|
||||
} else {
|
||||
fl_show_form(fd_form_paper->form_paper,
|
||||
FL_PLACE_MOUSE, FL_FULLBORDER,
|
||||
_("Paper Layout"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PaperApplyCB(FL_OBJECT *, long)
|
||||
{
|
||||
if (!current_view->available())
|
||||
return;
|
||||
|
||||
BufferParams * params = ¤t_view->buffer()->params;
|
||||
|
||||
FD_form_paper const * fd = fd_form_paper;
|
||||
|
||||
params->papersize2 = fl_get_choice(fd->choice_papersize2)-1;
|
||||
params->paperpackage = fl_get_choice(fd->choice_paperpackage)-1;
|
||||
params->use_geometry = fl_get_button(fd_form_paper->push_use_geometry);
|
||||
if (fl_get_button(fd_form_paper->radio_landscape))
|
||||
params->orientation = BufferParams::ORIENTATION_LANDSCAPE;
|
||||
else
|
||||
params->orientation = BufferParams::ORIENTATION_PORTRAIT;
|
||||
params->paperwidth = fl_get_input(fd->input_custom_width);
|
||||
params->paperheight = fl_get_input(fd->input_custom_height);
|
||||
params->leftmargin = fl_get_input(fd->input_left_margin);
|
||||
params->topmargin = fl_get_input(fd->input_top_margin);
|
||||
params->rightmargin = fl_get_input(fd->input_right_margin);
|
||||
params->bottommargin = fl_get_input(fd->input_bottom_margin);
|
||||
params->headheight = fl_get_input(fd->input_head_height);
|
||||
params->headsep = fl_get_input(fd->input_head_sep);
|
||||
params->footskip = fl_get_input(fd->input_foot_skip);
|
||||
current_view->buffer()->setPaperStuff();
|
||||
current_view->owner()->getMiniBuffer()->Set(_("Paper layout set"));
|
||||
current_view->buffer()->markDirty();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void PaperCancelCB(FL_OBJECT *, long)
|
||||
{
|
||||
fl_hide_form(fd_form_paper->form_paper);
|
||||
}
|
||||
|
||||
|
||||
void PaperOKCB(FL_OBJECT * ob, long data)
|
||||
{
|
||||
PaperCancelCB(ob, data);
|
||||
PaperApplyCB(ob, data);
|
||||
}
|
||||
|
||||
|
||||
void PaperMarginsCB(FL_OBJECT * ob, long)
|
||||
{
|
||||
FD_form_paper const * fd = fd_form_paper;
|
||||
string str;
|
||||
char val;
|
||||
|
||||
checkMarginValues();
|
||||
if (ob == fd->choice_papersize2) {
|
||||
val = fl_get_choice(fd->choice_papersize2)-1;
|
||||
if (val == BufferParams::VM_PAPER_DEFAULT) {
|
||||
fl_set_button(fd->push_use_geometry, 0);
|
||||
checkMarginValues();
|
||||
} else {
|
||||
if (val != BufferParams::VM_PAPER_USLETTER
|
||||
&& val != BufferParams::VM_PAPER_USLEGAL
|
||||
&& val != BufferParams::VM_PAPER_USEXECUTIVE
|
||||
&& val != BufferParams::VM_PAPER_A4
|
||||
&& val != BufferParams::VM_PAPER_A5
|
||||
&& val != BufferParams::VM_PAPER_B5) {
|
||||
fl_set_button(fd->push_use_geometry, 1);
|
||||
}
|
||||
fl_set_choice(fd->choice_paperpackage, BufferParams::PACKAGE_NONE + 1);
|
||||
}
|
||||
} else if (ob == fd->choice_paperpackage) {
|
||||
val = fl_get_choice(fd->choice_paperpackage)-1;
|
||||
if (val != BufferParams::PACKAGE_NONE) {
|
||||
fl_set_choice(fd->choice_papersize2,
|
||||
BufferParams::VM_PAPER_DEFAULT + 1);
|
||||
fl_set_button(fd->push_use_geometry, 0);
|
||||
}
|
||||
} else if (ob == fd->input_custom_width
|
||||
|| ob == fd->input_custom_height
|
||||
|| ob == fd->input_left_margin
|
||||
|| ob == fd->input_right_margin
|
||||
|| ob == fd->input_top_margin
|
||||
|| ob == fd->input_bottom_margin
|
||||
|| ob == fd->input_head_height
|
||||
|| ob == fd->input_head_sep
|
||||
|| ob == fd->input_foot_skip) {
|
||||
str = fl_get_input(ob);
|
||||
if (!str.empty() && !isValidLength(str)) {
|
||||
fl_set_object_label(fd_form_paper->text_warning,
|
||||
_("Warning: Invalid Length"
|
||||
" (valid example: 10mm)"));
|
||||
fl_show_object(fd_form_paper->text_warning);
|
||||
DeactivatePaperButtons();
|
||||
} else if (!str.empty())
|
||||
fl_set_button(fd->push_use_geometry, 1);
|
||||
}
|
||||
return;
|
||||
}
|
@ -1,320 +0,0 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include FORMS_H_LOCATION
|
||||
|
||||
#include "layout_forms.h"
|
||||
#include "LString.h"
|
||||
#include "minibuffer.h"
|
||||
#include "vspace.h"
|
||||
#include "buffer.h"
|
||||
#include "BufferView.h"
|
||||
#include "lyxparagraph.h"
|
||||
#include "gettext.h"
|
||||
#include "lyxtext.h"
|
||||
#include "LyXView.h"
|
||||
|
||||
extern FD_form_paragraph_extra * fd_form_paragraph_extra;
|
||||
extern BufferView * current_view;
|
||||
static bool CheckInputWidth();
|
||||
|
||||
inline
|
||||
void DeactivateParagraphExtraButtons ()
|
||||
{
|
||||
fl_deactivate_object(fd_form_paragraph_extra->button_ok);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->button_apply);
|
||||
fl_set_object_lcol(fd_form_paragraph_extra->button_ok, FL_INACTIVE);
|
||||
fl_set_object_lcol(fd_form_paragraph_extra->button_apply, FL_INACTIVE);
|
||||
}
|
||||
|
||||
inline
|
||||
void ActivateParagraphExtraButtons ()
|
||||
{
|
||||
fl_activate_object(fd_form_paragraph_extra->button_ok);
|
||||
fl_activate_object(fd_form_paragraph_extra->button_apply);
|
||||
fl_set_object_lcol(fd_form_paragraph_extra->button_ok, FL_BLACK);
|
||||
fl_set_object_lcol(fd_form_paragraph_extra->button_apply, FL_BLACK);
|
||||
}
|
||||
|
||||
inline
|
||||
void DisableParagraphExtra ()
|
||||
{
|
||||
DeactivateParagraphExtraButtons();
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->group_alignment);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->text_warning);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->group_extraopt);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_indent);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_minipage);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_floatflt);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_hfill);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_startmp);
|
||||
}
|
||||
|
||||
inline
|
||||
void EnableParagraphExtra ()
|
||||
{
|
||||
ActivateParagraphExtraButtons();
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_activate_object(fd_form_paragraph_extra->group_alignment);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
fl_activate_object(fd_form_paragraph_extra->text_warning);
|
||||
fl_activate_object(fd_form_paragraph_extra->group_extraopt);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_indent);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_minipage);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_floatflt);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_hfill);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_startmp);
|
||||
}
|
||||
|
||||
|
||||
bool UpdateParagraphExtra()
|
||||
{
|
||||
bool update = false;
|
||||
if (current_view->available()) {
|
||||
update = true;
|
||||
LyXParagraph * par = current_view->text->cursor.par();
|
||||
|
||||
EnableParagraphExtra();
|
||||
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_set_input(fd_form_paragraph_extra->input_pextra_width,
|
||||
par->pextra_width.c_str());
|
||||
fl_set_input(fd_form_paragraph_extra->input_pextra_widthp,
|
||||
par->pextra_widthp.c_str());
|
||||
switch(par->pextra_alignment) {
|
||||
case LyXParagraph::MINIPAGE_ALIGN_TOP:
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_top, 1);
|
||||
break;
|
||||
case LyXParagraph::MINIPAGE_ALIGN_MIDDLE:
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_middle, 1);
|
||||
break;
|
||||
case LyXParagraph::MINIPAGE_ALIGN_BOTTOM:
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_bottom, 1);
|
||||
break;
|
||||
}
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_hfill,
|
||||
par->pextra_hfill);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_startmp,
|
||||
par->pextra_start_minipage);
|
||||
CheckInputWidth();
|
||||
if (par->pextra_type == LyXParagraph::PEXTRA_INDENT) {
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 1);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
} else if (par->pextra_type == LyXParagraph::PEXTRA_MINIPAGE) {
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 1);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
} else if (par->pextra_type == LyXParagraph::PEXTRA_FLOATFLT) {
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 1);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
} else {
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
}
|
||||
if (par->pextra_type == LyXParagraph::PEXTRA_NONE)
|
||||
ActivateParagraphExtraButtons();
|
||||
}
|
||||
fl_hide_object(fd_form_paragraph_extra->text_warning);
|
||||
|
||||
if (current_view->buffer()->isReadonly()) {
|
||||
DisableParagraphExtra();
|
||||
fl_set_object_label(fd_form_paragraph_extra->text_warning,
|
||||
_("Document is read-only. "
|
||||
"No changes to layout permitted."));
|
||||
fl_show_object(fd_form_paragraph_extra->text_warning);
|
||||
}
|
||||
if (!update && fd_form_paragraph_extra->form_paragraph_extra->visible) {
|
||||
fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
|
||||
void ParagraphExtraOpen(FL_OBJECT *, long)
|
||||
{
|
||||
if (UpdateParagraphExtra()) {
|
||||
if (fd_form_paragraph_extra->form_paragraph_extra->visible) {
|
||||
fl_raise_form(fd_form_paragraph_extra->form_paragraph_extra);
|
||||
} else {
|
||||
fl_show_form(fd_form_paragraph_extra->form_paragraph_extra,
|
||||
FL_PLACE_MOUSE, FL_FULLBORDER,
|
||||
_("ParagraphExtra Layout"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ParagraphExtraApplyCB(FL_OBJECT *, long)
|
||||
{
|
||||
if (current_view->available()) {
|
||||
FD_form_paragraph_extra const * fd = fd_form_paragraph_extra;
|
||||
char const * width = fl_get_input(fd->input_pextra_width);
|
||||
char const * widthp = fl_get_input(fd->input_pextra_widthp);
|
||||
LyXText * text = current_view->text;
|
||||
int type = LyXParagraph::PEXTRA_NONE;
|
||||
LyXParagraph::MINIPAGE_ALIGNMENT alignment =
|
||||
LyXParagraph::MINIPAGE_ALIGN_TOP;
|
||||
bool
|
||||
hfill = false,
|
||||
start_minipage = false;
|
||||
|
||||
if (fl_get_button(fd_form_paragraph_extra->radio_pextra_indent)) {
|
||||
type = LyXParagraph::PEXTRA_INDENT;
|
||||
} else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage)) {
|
||||
type = LyXParagraph::PEXTRA_MINIPAGE;
|
||||
hfill = fl_get_button(fd_form_paragraph_extra->radio_pextra_hfill);
|
||||
start_minipage =
|
||||
fl_get_button(fd_form_paragraph_extra->radio_pextra_startmp);
|
||||
if (fl_get_button(fd_form_paragraph_extra->radio_pextra_top))
|
||||
alignment = LyXParagraph::MINIPAGE_ALIGN_TOP;
|
||||
else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_middle))
|
||||
alignment = LyXParagraph::MINIPAGE_ALIGN_MIDDLE;
|
||||
else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_bottom))
|
||||
alignment = LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
|
||||
} else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt)) {
|
||||
type = LyXParagraph::PEXTRA_FLOATFLT;
|
||||
}
|
||||
text->SetParagraphExtraOpt(current_view, type, width, widthp, alignment, hfill,
|
||||
start_minipage);
|
||||
current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
current_view->owner()->getMiniBuffer()->
|
||||
Set(_("ParagraphExtra layout set"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void ParagraphExtraCancelCB(FL_OBJECT *, long)
|
||||
{
|
||||
fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra);
|
||||
}
|
||||
|
||||
|
||||
void ParagraphExtraOKCB(FL_OBJECT * ob, long data)
|
||||
{
|
||||
ParagraphExtraCancelCB(ob, data);
|
||||
ParagraphExtraApplyCB(ob, data);
|
||||
}
|
||||
|
||||
|
||||
void CheckPExtraOptCB(FL_OBJECT * ob, long)
|
||||
{
|
||||
ActivateParagraphExtraButtons();
|
||||
CheckInputWidth();
|
||||
if (ob == fd_form_paragraph_extra->radio_pextra_indent) {
|
||||
int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_indent);
|
||||
if (n) {
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
} else {
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
ActivateParagraphExtraButtons();
|
||||
}
|
||||
} else if (ob == fd_form_paragraph_extra->radio_pextra_minipage) {
|
||||
int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage);
|
||||
if (n) {
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
} else {
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
ActivateParagraphExtraButtons();
|
||||
}
|
||||
} else if (ob == fd_form_paragraph_extra->radio_pextra_floatflt) {
|
||||
int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt);
|
||||
if (n) {
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
|
||||
fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
} else {
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
|
||||
ActivateParagraphExtraButtons();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
bool CheckInputWidth()
|
||||
{
|
||||
string s1 = fl_get_input(fd_form_paragraph_extra->input_pextra_width);
|
||||
string s2 = fl_get_input(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
if (s1.empty() && s2.empty()) {
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
fl_hide_object(fd_form_paragraph_extra->text_warning);
|
||||
DeactivateParagraphExtraButtons();
|
||||
return false;
|
||||
}
|
||||
if (!s1.empty()) { // LyXLength parameter
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
if (!isValidLength(s1)) {
|
||||
DeactivateParagraphExtraButtons();
|
||||
fl_set_object_label(fd_form_paragraph_extra->text_warning,
|
||||
_("Warning: Invalid Length (valid example: 10mm)"));
|
||||
fl_show_object(fd_form_paragraph_extra->text_warning);
|
||||
return false;
|
||||
}
|
||||
} else { // !s2.empty() % parameter
|
||||
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
|
||||
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
|
||||
if ((atoi(s2.c_str()) < 0 ) || (atoi(s2.c_str()) > 100)) {
|
||||
DeactivateParagraphExtraButtons();
|
||||
fl_set_object_label(fd_form_paragraph_extra->text_warning,
|
||||
_("Warning: Invalid percent value (0-100)"));
|
||||
fl_show_object(fd_form_paragraph_extra->text_warning);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
fl_hide_object(fd_form_paragraph_extra->text_warning);
|
||||
return true;
|
||||
}
|
@ -21,8 +21,10 @@
|
||||
|
||||
#ifdef ENABLE_ASSERTIONS
|
||||
#include "support/LAssert.h"
|
||||
extern bool containsOnly(string const &, char const *);
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
This struct contains (or should contain) all the parameters required for
|
||||
printing a buffer. Some work still needs to be done on this struct and
|
||||
@ -33,7 +35,7 @@
|
||||
*/
|
||||
struct PrinterParams {
|
||||
///
|
||||
enum Target{
|
||||
enum Target {
|
||||
///
|
||||
PRINTER,
|
||||
///
|
||||
@ -131,7 +133,6 @@ struct PrinterParams {
|
||||
void testInvariant() const
|
||||
{
|
||||
#ifdef ENABLE_ASSERTIONS
|
||||
extern bool containsOnly(string const &, char const *);
|
||||
if (!from_page.empty()) {
|
||||
// Assert(from_page == number or empty)
|
||||
Assert(containsOnly(from_page, "1234567890"));
|
||||
@ -166,6 +167,3 @@ struct PrinterParams {
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
228
src/buffer.C
228
src/buffer.C
@ -109,9 +109,6 @@ using std::istringstream;
|
||||
// all these externs should eventually be removed.
|
||||
extern BufferList bufferlist;
|
||||
|
||||
#ifndef NEW_EXPORT
|
||||
extern void MenuExport(Buffer *, string const &);
|
||||
#endif
|
||||
extern LyXAction lyxaction;
|
||||
|
||||
|
||||
@ -189,9 +186,9 @@ void Buffer::setReadonly(bool flag)
|
||||
}
|
||||
|
||||
|
||||
bool Buffer::saveParamsAsDefaults()
|
||||
bool Buffer::saveParamsAsDefaults() // const
|
||||
{
|
||||
string fname = AddName(AddPath(user_lyxdir, "templates/"),
|
||||
string const fname = AddName(AddPath(user_lyxdir, "templates/"),
|
||||
"defaults.lyx");
|
||||
Buffer defaults = Buffer(fname);
|
||||
|
||||
@ -240,7 +237,6 @@ void Buffer::fileName(string const & newfile)
|
||||
// Returns false if "\the_end" is not read for formats >= 2.13. (Asger)
|
||||
bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
|
||||
{
|
||||
string tmptok;
|
||||
int pos = 0;
|
||||
char depth = 0; // signed or unsigned?
|
||||
#ifndef NEW_INSETS
|
||||
@ -285,19 +281,17 @@ bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
|
||||
pretoken = lex.GetString();
|
||||
}
|
||||
|
||||
// Profiling show this should give a lot: (Asger)
|
||||
string const token = pretoken;
|
||||
if (pretoken.empty()) continue;
|
||||
|
||||
if (token.empty())
|
||||
continue;
|
||||
the_end_read = parseSingleLyXformat2Token(lex, par, return_par,
|
||||
token, pos, depth,
|
||||
font
|
||||
the_end_read =
|
||||
parseSingleLyXformat2Token(lex, par, return_par,
|
||||
pretoken, pos, depth,
|
||||
font
|
||||
#ifndef NEW_INSETS
|
||||
, footnoteflag,
|
||||
footnotekind
|
||||
, footnoteflag,
|
||||
footnotekind
|
||||
#endif
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
if (!return_par)
|
||||
@ -346,7 +340,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
}
|
||||
pos = 0;
|
||||
lex.EatLine();
|
||||
string layoutname = lex.GetString();
|
||||
string const layoutname = lex.GetString();
|
||||
pair<bool, LyXTextClass::LayoutList::size_type> pp
|
||||
= textclasslist.NumberOfLayout(params.textclass,
|
||||
layoutname);
|
||||
@ -403,7 +397,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
// This is the compability reader, unfinished but tested.
|
||||
// (Lgb)
|
||||
lex.next();
|
||||
string tmptok = lex.GetString();
|
||||
string const tmptok = lex.GetString();
|
||||
//lyxerr << "old float: " << tmptok << endl;
|
||||
|
||||
Inset * inset = 0;
|
||||
@ -443,7 +437,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
// This _is_ a hack! (Lgb)
|
||||
while(true) {
|
||||
lex.next();
|
||||
string tmp = lex.GetString();
|
||||
string const tmp = lex.GetString();
|
||||
if (tmp == "\\end_deeper") {
|
||||
lyxerr << "\\end_deeper caught!" << endl;
|
||||
if (!depth) {
|
||||
@ -657,7 +651,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
params.pagestyle = strip(lex.GetString());
|
||||
} else if (token == "\\bullet") {
|
||||
lex.nextToken();
|
||||
int index = lex.GetInteger();
|
||||
int const index = lex.GetInteger();
|
||||
lex.nextToken();
|
||||
int temp_int = lex.GetInteger();
|
||||
params.user_defined_bullets[index].setFont(temp_int);
|
||||
@ -671,7 +665,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
params.user_defined_bullets[index].setSize(temp_int);
|
||||
params.temp_bullets[index].setSize(temp_int);
|
||||
lex.nextToken();
|
||||
string temp_str = lex.GetString();
|
||||
string const temp_str = lex.GetString();
|
||||
if (temp_str != "\\end_bullet") {
|
||||
// this element isn't really necessary for
|
||||
// parsing but is easier for humans
|
||||
@ -682,9 +676,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
}
|
||||
} else if (token == "\\bulletLaTeX") {
|
||||
lex.nextToken();
|
||||
int index = lex.GetInteger();
|
||||
int const index = lex.GetInteger();
|
||||
lex.next();
|
||||
string temp_str = lex.GetString(), sum_str;
|
||||
string temp_str = lex.GetString();
|
||||
string sum_str;
|
||||
while (temp_str != "\\end_bullet") {
|
||||
// this loop structure is needed when user
|
||||
// enters an empty string since the first
|
||||
@ -706,7 +701,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
params.tocdepth = lex.GetInteger();
|
||||
} else if (token == "\\spacing") {
|
||||
lex.next();
|
||||
string tmp = strip(lex.GetString());
|
||||
string const tmp = strip(lex.GetString());
|
||||
Spacing::Space tmp_space = Spacing::Default;
|
||||
float tmp_val = 0.0;
|
||||
if (tmp == "single") {
|
||||
@ -731,7 +726,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
}
|
||||
} else if (token == "\\paragraph_spacing") {
|
||||
lex.next();
|
||||
string tmp = strip(lex.GetString());
|
||||
string const tmp = strip(lex.GetString());
|
||||
if (tmp == "single") {
|
||||
par->spacing.set(Spacing::Single);
|
||||
} else if (tmp == "onehalf") {
|
||||
@ -762,7 +757,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
font.setLyXSize(lex.GetString());
|
||||
} else if (token == "\\latex") {
|
||||
lex.next();
|
||||
string tok = lex.GetString();
|
||||
string const tok = lex.GetString();
|
||||
// This is dirty, but gone with LyX3. (Asger)
|
||||
if (tok == "no_latex")
|
||||
font.setLatex(LyXFont::OFF);
|
||||
@ -775,7 +770,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
"`$$Token'");
|
||||
} else if (token == "\\lang") {
|
||||
lex.next();
|
||||
string tok = lex.GetString();
|
||||
string const tok = lex.GetString();
|
||||
Languages::iterator lit = languages.find(tok);
|
||||
if (lit != languages.end()) {
|
||||
font.setLanguage(&(*lit).second);
|
||||
@ -788,7 +783,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
|
||||
font.setEmph(font.setLyXMisc(lex.GetString()));
|
||||
} else if (token == "\\bar") {
|
||||
lex.next();
|
||||
string tok = lex.GetString();
|
||||
string const tok = lex.GetString();
|
||||
// This is dirty, but gone with LyX3. (Asger)
|
||||
if (tok == "under")
|
||||
font.setUnderbar(LyXFont::ON);
|
||||
@ -942,7 +937,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
|
||||
}
|
||||
|
||||
lex.next();
|
||||
string tmptok = lex.GetString();
|
||||
string const tmptok = lex.GetString();
|
||||
last_inset_read = tmptok;
|
||||
// test the different insets
|
||||
if (tmptok == "Quotes") {
|
||||
@ -1013,7 +1008,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
|
||||
++pos;
|
||||
} else if (tmptok == "Float") {
|
||||
lex.next();
|
||||
string tmptok = lex.GetString();
|
||||
string const tmptok = lex.GetString();
|
||||
Inset * inset = new InsetFloat(tmptok);
|
||||
inset->Read(this, lex);
|
||||
par->InsertInset(pos, inset, font);
|
||||
@ -1090,7 +1085,7 @@ bool Buffer::readFile(LyXLex & lex, LyXParagraph * par)
|
||||
{
|
||||
if (lex.IsOK()) {
|
||||
lex.next();
|
||||
string token(lex.GetString());
|
||||
string const token(lex.GetString());
|
||||
if (token == "\\lyxformat") { // the first token _must_ be...
|
||||
lex.EatLine();
|
||||
format = lex.GetFloat();
|
||||
@ -1205,7 +1200,7 @@ bool Buffer::save() const
|
||||
} else {
|
||||
// Saving failed, so backup is not backup
|
||||
if (lyxrc.make_backup) {
|
||||
::rename(s.c_str(), fileName().c_str());
|
||||
lyx::rename(s, fileName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1295,9 +1290,10 @@ bool Buffer::writeFile(string const & fname, bool flag) const
|
||||
|
||||
void Buffer::writeFileAscii(string const & fname, int linelen)
|
||||
{
|
||||
LyXFont font1, font2;
|
||||
Inset * inset;
|
||||
char c, footnoteflag = 0, depth = 0;
|
||||
char c;
|
||||
char footnoteflag = 0;
|
||||
char depth = 0;
|
||||
string tmp;
|
||||
LyXParagraph::size_type i;
|
||||
int j;
|
||||
@ -1315,7 +1311,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
|
||||
return;
|
||||
}
|
||||
|
||||
string fname1 = TmpFileName();
|
||||
string const fname1 = TmpFileName();
|
||||
LyXParagraph * par = paragraph;
|
||||
while (par) {
|
||||
int noparbreak = 0;
|
||||
@ -1367,10 +1363,10 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
|
||||
} else if (tmp == "Enumerate") {
|
||||
ltype = 2;
|
||||
ltype_depth = depth+1;
|
||||
} else if (strstr(tmp.c_str(), "ection")) {
|
||||
} else if (contains(tmp, "ection")) {
|
||||
ltype = 3;
|
||||
ltype_depth = depth+1;
|
||||
} else if (strstr(tmp.c_str(), "aragraph")) {
|
||||
} else if (contains(tmp, "aragraph")) {
|
||||
ltype = 4;
|
||||
ltype_depth = depth+1;
|
||||
} else if (tmp == "Description") {
|
||||
@ -1409,7 +1405,8 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
|
||||
#endif
|
||||
}
|
||||
|
||||
font1 = LyXFont(LyXFont::ALL_INHERIT, params.language_info);
|
||||
LyXFont font1 =
|
||||
LyXFont(LyXFont::ALL_INHERIT, params.language_info);
|
||||
actcell = 0;
|
||||
for (i = 0, actpos = 1; i < par->size(); ++i, ++actpos) {
|
||||
if (!i && !footnoteflag && !noparbreak){
|
||||
@ -1441,7 +1438,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
|
||||
currlinelen += (ltype_depth-depth)*2;
|
||||
}
|
||||
}
|
||||
font2 = par->GetFontSettings(params, i);
|
||||
LyXFont font2 = par->GetFontSettings(params, i);
|
||||
if (font1.latex() != font2.latex()) {
|
||||
if (font2.latex() == LyXFont::OFF)
|
||||
islatex = 0;
|
||||
@ -1677,7 +1674,7 @@ void Buffer::makeLaTeXFile(string const & fname,
|
||||
}
|
||||
|
||||
if (params.inputenc == "auto") {
|
||||
string doc_encoding =
|
||||
string const doc_encoding =
|
||||
params.language_info->encoding()->LatexName();
|
||||
|
||||
// Create a list with all the input encodings used
|
||||
@ -2187,7 +2184,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
|
||||
Inset * inset = par->GetInset(0);
|
||||
Inset::Code lyx_code = inset->LyxCode();
|
||||
if (lyx_code == Inset::TOC_CODE){
|
||||
string temp = "toc";
|
||||
string const temp = "toc";
|
||||
sgmlOpenTag(ofs, depth, temp);
|
||||
|
||||
par = par->next;
|
||||
@ -2199,13 +2196,13 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
|
||||
}
|
||||
|
||||
// environment tag closing
|
||||
for( ; depth > par->depth; --depth) {
|
||||
for (; depth > par->depth; --depth) {
|
||||
sgmlCloseTag(ofs, depth, environment_stack[depth]);
|
||||
environment_stack[depth].erase();
|
||||
}
|
||||
|
||||
// write opening SGML tags
|
||||
switch(style.latextype) {
|
||||
switch (style.latextype) {
|
||||
case LATEX_PARAGRAPH:
|
||||
if(depth == par->depth
|
||||
&& !environment_stack[depth].empty()) {
|
||||
@ -2237,7 +2234,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
|
||||
|
||||
case LATEX_ENVIRONMENT:
|
||||
case LATEX_ITEM_ENVIRONMENT:
|
||||
if(depth == par->depth
|
||||
if (depth == par->depth
|
||||
&& environment_stack[depth] != style.latexname()
|
||||
&& !environment_stack[depth].empty()) {
|
||||
|
||||
@ -2251,7 +2248,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
|
||||
}
|
||||
if (environment_stack[depth] != style.latexname()) {
|
||||
if(depth == 0) {
|
||||
string temp = "p";
|
||||
string const temp = "p";
|
||||
sgmlOpenTag(ofs, depth, temp);
|
||||
}
|
||||
environment_stack[depth] = style.latexname();
|
||||
@ -2320,7 +2317,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
|
||||
void Buffer::linuxDocHandleFootnote(ostream & os, LyXParagraph * & par,
|
||||
int const depth)
|
||||
{
|
||||
string tag = "footnote";
|
||||
string const tag = "footnote";
|
||||
|
||||
while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
|
||||
sgmlOpenTag(os, depth + 1, tag);
|
||||
@ -2379,9 +2376,9 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par,
|
||||
SOME_ENUM present = FOOTNOTE_LIKE;
|
||||
|
||||
while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
|
||||
if(last == present) {
|
||||
if(inner_span) {
|
||||
if(!tmp_par.empty()) {
|
||||
if (last == present) {
|
||||
if (inner_span) {
|
||||
if (!tmp_par.empty()) {
|
||||
os << tmp_par;
|
||||
tmp_par.erase();
|
||||
sgmlCloseTag(os, depth + 1, inner_tag);
|
||||
@ -2392,10 +2389,10 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par,
|
||||
}
|
||||
} else {
|
||||
os << tmp_par;
|
||||
if(!inner_tag.empty()) sgmlCloseTag(os, depth + 1,
|
||||
if (!inner_tag.empty()) sgmlCloseTag(os, depth + 1,
|
||||
inner_tag);
|
||||
if(!extra_par.empty()) os << extra_par;
|
||||
if(!tag.empty()) sgmlCloseTag(os, depth, tag);
|
||||
if (!extra_par.empty()) os << extra_par;
|
||||
if (!tag.empty()) sgmlCloseTag(os, depth, tag);
|
||||
extra_par.erase();
|
||||
|
||||
switch (par->footnotekind) {
|
||||
@ -2521,7 +2518,7 @@ void linux_doc_line_break(ostream & os, unsigned int & colcount,
|
||||
void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
|
||||
int desc_on, int const /*depth*/)
|
||||
{
|
||||
LyXFont font1, font2;
|
||||
LyXFont font1;
|
||||
char c;
|
||||
Inset * inset;
|
||||
LyXParagraph::size_type main_body;
|
||||
@ -2565,7 +2562,7 @@ void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
|
||||
font1 = style.font;
|
||||
}
|
||||
|
||||
font2 = par->getFont(params, i);
|
||||
LyXFont const font2 = par->getFont(params, i);
|
||||
|
||||
if (font1.family() != font2.family()) {
|
||||
switch(family_type) {
|
||||
@ -2856,7 +2853,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
|
||||
tmps = style.latexparam();
|
||||
c_params = split(tmps, c_depth,'|');
|
||||
|
||||
cmd_depth= atoi(c_depth.c_str());
|
||||
cmd_depth= lyx::atoi(c_depth);
|
||||
|
||||
if(command_flag) {
|
||||
if(cmd_depth<command_base) {
|
||||
@ -3141,74 +3138,6 @@ void Buffer::SimpleDocBookOnePar(ostream & os, string & extra,
|
||||
}
|
||||
|
||||
|
||||
int Buffer::runLaTeX()
|
||||
{
|
||||
#ifndef NEW_EXPORT
|
||||
|
||||
if (!users->text) return 0;
|
||||
|
||||
ProhibitInput(users);
|
||||
|
||||
// get LaTeX-Filename
|
||||
string name = getLatexName();
|
||||
|
||||
string path = OnlyPath(filename);
|
||||
|
||||
string org_path = path;
|
||||
if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
|
||||
path = tmppath;
|
||||
}
|
||||
|
||||
Path p(path); // path to LaTeX file
|
||||
users->owner()->getMiniBuffer()->Set(_("Running LaTeX..."));
|
||||
|
||||
// Remove all error insets
|
||||
bool a = users->removeAutoInsets();
|
||||
|
||||
// Always generate the LaTeX file
|
||||
makeLaTeXFile(name, org_path, false);
|
||||
|
||||
// do the LaTex run(s)
|
||||
TeXErrors terr;
|
||||
string latex_command = lyxrc.pdf_mode ?
|
||||
lyxrc.pdflatex_command : lyxrc.latex_command;
|
||||
LaTeX latex(latex_command, name, filepath);
|
||||
int res = latex.run(terr,
|
||||
users->owner()->getMiniBuffer()); // running latex
|
||||
|
||||
// check return value from latex.run().
|
||||
if ((res & LaTeX::NO_LOGFILE)) {
|
||||
WriteAlert(_("LaTeX did not work!"),
|
||||
_("Missing log file:"), name);
|
||||
} else if ((res & LaTeX::ERRORS)) {
|
||||
users->owner()->getMiniBuffer()->Set(_("Done"));
|
||||
// Insert all errors as errors boxes
|
||||
users->insertErrors(terr);
|
||||
|
||||
// Dvi should also be kept dirty if the latex run
|
||||
// ends up with errors. However it should be possible
|
||||
// to view a dirty dvi too.
|
||||
} else {
|
||||
//no errors or any other things to think about so:
|
||||
users->owner()->getMiniBuffer()->Set(_("Done"));
|
||||
}
|
||||
|
||||
// if we removed error insets before we ran LaTeX or if we inserted
|
||||
// error insets after we ran LaTeX this must be run:
|
||||
if (a || (res & LaTeX::ERRORS)){
|
||||
users->redraw();
|
||||
users->fitCursor();
|
||||
//users->updateScrollbar();
|
||||
}
|
||||
AllowInput(users);
|
||||
|
||||
return latex.getNumErrors();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int Buffer::runLiterate()
|
||||
{
|
||||
if (!users->text) return 0;
|
||||
@ -3314,7 +3243,7 @@ int Buffer::buildProgram()
|
||||
lyxrc.literate_command, lyxrc.literate_error_filter,
|
||||
lyxrc.build_command, lyxrc.build_error_filter);
|
||||
TeXErrors terr;
|
||||
int res = literate.build(terr, users->owner()->getMiniBuffer());
|
||||
int const res = literate.build(terr, users->owner()->getMiniBuffer());
|
||||
|
||||
// check return value from literate.build().
|
||||
if ((res & Literate::NO_LOGFILE)) {
|
||||
@ -3357,10 +3286,10 @@ int Buffer::runChktex()
|
||||
ProhibitInput(users);
|
||||
|
||||
// get LaTeX-Filename
|
||||
string name = getLatexName();
|
||||
string const name = getLatexName();
|
||||
string path = OnlyPath(filename);
|
||||
|
||||
string org_path = path;
|
||||
string const org_path = path;
|
||||
if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
|
||||
path = tmppath;
|
||||
}
|
||||
@ -3369,7 +3298,7 @@ int Buffer::runChktex()
|
||||
users->owner()->getMiniBuffer()->Set(_("Running chktex..."));
|
||||
|
||||
// Remove all error insets
|
||||
bool removedErrorInsets = users->removeAutoInsets();
|
||||
bool const removedErrorInsets = users->removeAutoInsets();
|
||||
|
||||
// Generate the LaTeX file if neccessary
|
||||
makeLaTeXFile(name, org_path, false);
|
||||
@ -3427,9 +3356,9 @@ void Buffer::validate(LaTeXFeatures & features) const
|
||||
// so they are tested here
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (params.user_defined_bullets[i] != ITEMIZE_DEFAULTS[i]) {
|
||||
int font = params.user_defined_bullets[i].getFont();
|
||||
int const font = params.user_defined_bullets[i].getFont();
|
||||
if (font == 0) {
|
||||
int c = params
|
||||
int const c = params
|
||||
.user_defined_bullets[i]
|
||||
.getCharacter();
|
||||
if (c == 16
|
||||
@ -3439,11 +3368,9 @@ void Buffer::validate(LaTeXFeatures & features) const
|
||||
|| c == 31) {
|
||||
features.latexsym = true;
|
||||
}
|
||||
}
|
||||
if (font == 1) {
|
||||
} else if (font == 1) {
|
||||
features.amssymb = true;
|
||||
}
|
||||
else if ((font >= 2 && font <= 5)) {
|
||||
} else if ((font >= 2 && font <= 5)) {
|
||||
features.pifont = true;
|
||||
}
|
||||
}
|
||||
@ -3458,9 +3385,9 @@ void Buffer::validate(LaTeXFeatures & features) const
|
||||
void Buffer::setPaperStuff()
|
||||
{
|
||||
params.papersize = BufferParams::PAPER_DEFAULT;
|
||||
char c1 = params.paperpackage;
|
||||
char const c1 = params.paperpackage;
|
||||
if (c1 == BufferParams::PACKAGE_NONE) {
|
||||
char c2 = params.papersize2;
|
||||
char const c2 = params.papersize2;
|
||||
if (c2 == BufferParams::VM_PAPER_USLETTER)
|
||||
params.papersize = BufferParams::PAPER_USLETTER;
|
||||
else if (c2 == BufferParams::VM_PAPER_USLEGAL)
|
||||
@ -3518,7 +3445,7 @@ vector<string> const Buffer::getLabelList()
|
||||
vector<string> label_list;
|
||||
for (inset_iterator it = inset_iterator_begin();
|
||||
it != inset_iterator_end(); ++it) {
|
||||
vector<string> l = (*it)->getLabelList();
|
||||
vector<string> const l = (*it)->getLabelList();
|
||||
label_list.insert(label_list.end(), l.begin(), l.end());
|
||||
}
|
||||
return label_list;
|
||||
@ -3558,8 +3485,9 @@ vector<vector<Buffer::TocItem> > const Buffer::getTocList()
|
||||
}
|
||||
} else if (!par->IsDummy()) {
|
||||
#endif
|
||||
char labeltype = textclasslist.Style(params.textclass,
|
||||
par->GetLayout()).labeltype;
|
||||
char const labeltype =
|
||||
textclasslist.Style(params.textclass,
|
||||
par->GetLayout()).labeltype;
|
||||
|
||||
if (labeltype >= LABEL_COUNTER_CHAPTER
|
||||
&& labeltype <= LABEL_COUNTER_CHAPTER + params.tocdepth) {
|
||||
@ -3611,7 +3539,7 @@ vector<pair<string,string> > const Buffer::getBibkeyList()
|
||||
static_cast<InsetBibtex*>(*it)->getKeys();
|
||||
keys.insert(keys.end(), tmp.begin(), tmp.end());
|
||||
} else if ((*it)->LyxCode() == Inset::INCLUDE_CODE) {
|
||||
vector<pair<string,string> > tmp =
|
||||
vector<pair<string,string> > const tmp =
|
||||
static_cast<InsetInclude*>(*it)->getKeys();
|
||||
keys.insert(keys.end(), tmp.begin(), tmp.end());
|
||||
}
|
||||
@ -3640,7 +3568,7 @@ void Buffer::markDepClean(string const & name)
|
||||
dep_clean->master = name;
|
||||
dep_clean->next = 0;
|
||||
} else {
|
||||
DEPCLEAN* item = dep_clean;
|
||||
DEPCLEAN * item = dep_clean;
|
||||
while (item && item->master != name)
|
||||
item = item->next;
|
||||
if (item) {
|
||||
@ -3658,10 +3586,11 @@ void Buffer::markDepClean(string const & name)
|
||||
bool Buffer::Dispatch(string const & command)
|
||||
{
|
||||
// Split command string into command and argument
|
||||
string cmd, line = frontStrip(command);
|
||||
string arg = strip(frontStrip(split(line, cmd, ' ')));
|
||||
string cmd;
|
||||
string line = frontStrip(command);
|
||||
string const arg = strip(frontStrip(split(line, cmd, ' ')));
|
||||
|
||||
return Dispatch(lyxaction.LookupFunc(cmd.c_str()), arg);
|
||||
return Dispatch(lyxaction.LookupFunc(cmd), arg);
|
||||
}
|
||||
|
||||
|
||||
@ -3670,11 +3599,7 @@ bool Buffer::Dispatch(int action, string const & argument)
|
||||
bool dispatched = true;
|
||||
switch (action) {
|
||||
case LFUN_EXPORT:
|
||||
#ifdef NEW_EXPORT
|
||||
Exporter::Export(this, argument, false);
|
||||
#else
|
||||
MenuExport(this, argument);
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -3696,7 +3621,7 @@ void Buffer::resizeInsets(BufferView * bv)
|
||||
{
|
||||
/// then remove all LyXText in text-insets
|
||||
LyXParagraph * par = paragraph;
|
||||
for(;par;par = par->next) {
|
||||
for(; par; par = par->next) {
|
||||
par->resizeInsetsLyXText(bv);
|
||||
}
|
||||
}
|
||||
@ -3714,7 +3639,6 @@ void Buffer::ChangeLanguage(Language const * from, Language const * to)
|
||||
|
||||
bool Buffer::isMultiLingual()
|
||||
{
|
||||
|
||||
LyXParagraph * par = paragraph;
|
||||
while (par) {
|
||||
if (par->isMultiLingual(params))
|
||||
@ -3727,7 +3651,8 @@ bool Buffer::isMultiLingual()
|
||||
|
||||
Buffer::inset_iterator::inset_iterator(LyXParagraph * paragraph,
|
||||
LyXParagraph::size_type pos)
|
||||
: par(paragraph) {
|
||||
: par(paragraph)
|
||||
{
|
||||
it = par->InsetIterator(pos);
|
||||
if (it == par->inset_iterator_end()) {
|
||||
par = par->next;
|
||||
@ -3736,7 +3661,8 @@ Buffer::inset_iterator::inset_iterator(LyXParagraph * paragraph,
|
||||
}
|
||||
|
||||
|
||||
void Buffer::inset_iterator::SetParagraph() {
|
||||
void Buffer::inset_iterator::SetParagraph()
|
||||
{
|
||||
while (par) {
|
||||
it = par->inset_iterator_begin();
|
||||
if (it != par->inset_iterator_end())
|
||||
|
@ -161,9 +161,6 @@ public:
|
||||
void latexParagraphs(std::ostream & os, LyXParagraph * par,
|
||||
LyXParagraph * endpar, TexRow & texrow) const;
|
||||
|
||||
///
|
||||
int runLaTeX();
|
||||
|
||||
///
|
||||
int runLiterate();
|
||||
|
||||
|
@ -183,7 +183,7 @@ bool BufferList::close(Buffer * buf)
|
||||
else
|
||||
fname = MakeDisplayPath(buf->fileName(), 50);
|
||||
bool reask = true;
|
||||
while(reask) {
|
||||
while (reask) {
|
||||
switch(AskConfirmation(_("Changes in document:"),
|
||||
fname,
|
||||
_("Save document?"))){
|
||||
@ -362,7 +362,7 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
|
||||
use_emergency = true;
|
||||
} else {
|
||||
// Here, we should delete the emergency save
|
||||
::unlink(e.c_str());
|
||||
lyx::unlink(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -385,7 +385,7 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
|
||||
b->markDirty();
|
||||
} else {
|
||||
// Here, we should delete the autosave
|
||||
::unlink(a.c_str());
|
||||
lyx::unlink(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -473,7 +473,7 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
|
||||
Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
|
||||
{
|
||||
// make sure our path is absolute
|
||||
string s = MakeAbsPath(filename);
|
||||
string const s = MakeAbsPath(filename);
|
||||
|
||||
// file already open?
|
||||
if (exists(s)) {
|
||||
|
@ -165,7 +165,7 @@ void BufferParams::writeFile(ostream & os) const
|
||||
else {
|
||||
os << "\\bulletLaTeX " << i
|
||||
<< "\n\t"
|
||||
<< user_defined_bullets[i].getText().c_str()
|
||||
<< user_defined_bullets[i].getText()
|
||||
<< "\n\\end_bullet\n";
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "lyx_cb.h"
|
||||
#include "layout_forms.h"
|
||||
|
||||
extern FD_form_paragraph * fd_form_paragraph;
|
||||
extern FD_form_character * fd_form_character;
|
||||
|
||||
#ifndef NEW_INSETS
|
||||
@ -168,10 +167,7 @@ void ProhibitInput(BufferView * bv)
|
||||
/* set the cursor to the watch for all forms and the canvas */
|
||||
XDefineCursor(fl_display, bv->owner()->getForm()->window,
|
||||
cursor);
|
||||
if (fd_form_paragraph->form_paragraph->visible)
|
||||
XDefineCursor(fl_display,
|
||||
fd_form_paragraph->form_paragraph->window,
|
||||
cursor);
|
||||
|
||||
if (fd_form_character->form_character->visible)
|
||||
XDefineCursor(fl_display,
|
||||
fd_form_character->form_character->window,
|
||||
@ -187,9 +183,7 @@ void AllowInput(BufferView * bv)
|
||||
/* reset the cursor from the watch for all forms and the canvas */
|
||||
|
||||
XUndefineCursor(fl_display, bv->owner()->getForm()->window);
|
||||
if (fd_form_paragraph->form_paragraph->visible)
|
||||
XUndefineCursor(fl_display,
|
||||
fd_form_paragraph->form_paragraph->window);
|
||||
|
||||
if (fd_form_character->form_character->visible)
|
||||
XUndefineCursor(fl_display,
|
||||
fd_form_character->form_character->window);
|
||||
|
@ -1,113 +0,0 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
|
||||
/* Form definition file generated with fdesign. */
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
#include <cstdlib>
|
||||
#include "bullet_forms.h"
|
||||
#include "bmtable.h"
|
||||
#include "support/filetools.h"
|
||||
|
||||
FD_form_bullet *create_form_form_bullet(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_bullet *fdui = (FD_form_bullet *) fl_calloc(1, sizeof(FD_form_bullet));
|
||||
|
||||
fdui->form_bullet = fl_bgn_form(FL_NO_BOX, 370, 390);
|
||||
fl_set_border_width(-1);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 370, 390, "");
|
||||
|
||||
// make the border thick again to improve the bmtable looks
|
||||
fl_set_border_width(-3);
|
||||
|
||||
fdui->bmtable_bullet_panel = obj = fl_add_bmtable(1, 90, 105, 265, 180, "");
|
||||
fl_set_object_callback(obj, BulletBMTableCB, 0);
|
||||
fl_set_object_lcol(obj, FL_BLUE);
|
||||
fl_set_object_boxtype(obj, FL_UP_BOX);
|
||||
fl_set_bmtable_pixmap_file(obj, 6, 6,
|
||||
LibFileSearch("images",
|
||||
"standard", "xpm").c_str());
|
||||
|
||||
fl_set_border_width(-1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, "");
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 0, 340, 370, 50, "");
|
||||
fdui->choice_bullet_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 15, 45, 65, 30, idex(_("Size|#z")));fl_set_button_shortcut(obj, scex(_("Size|#z")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_TOP);
|
||||
fl_set_object_callback(obj, ChoiceBulletSizeCB, 0);
|
||||
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 25, 350, 100, 30, _("OK"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, BulletOKCB, 0);
|
||||
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 135, 350, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, BulletApplyCB, 0);
|
||||
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 350, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, BulletCancelCB, 0);
|
||||
fdui->input_bullet_latex = obj = fl_add_input(FL_NORMAL_INPUT, 80, 300, 275, 30, idex(_("LaTeX|#L")));fl_set_button_shortcut(obj, scex(_("LaTeX|#L")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lstyle(obj, FL_FIXED_STYLE);
|
||||
fl_set_input_return(obj, FL_RETURN_CHANGED);
|
||||
fl_set_input_maxchars(obj, 80);
|
||||
fl_set_object_callback(obj, InputBulletLaTeXCB, 0);
|
||||
|
||||
fdui->radio_bullet_depth = fl_bgn_group();
|
||||
fdui->radio_bullet_depth_1 = obj = fl_add_button(FL_RADIO_BUTTON, 105, 35, 55, 40, idex(_("1|#1")));fl_set_button_shortcut(obj, scex(_("1|#1")), 1);
|
||||
fl_set_object_lsize(obj, FL_LARGE_SIZE);
|
||||
fl_set_object_callback(obj, BulletDepthCB, 0);
|
||||
fl_set_button(obj, 1);
|
||||
fdui->radio_bullet_depth_2 = obj = fl_add_button(FL_RADIO_BUTTON, 165, 35, 55, 40, idex(_("2|#2")));fl_set_button_shortcut(obj, scex(_("2|#2")), 1);
|
||||
fl_set_object_lsize(obj, FL_LARGE_SIZE);
|
||||
fl_set_object_callback(obj, BulletDepthCB, 1);
|
||||
fdui->radio_bullet_depth_3 = obj = fl_add_button(FL_RADIO_BUTTON, 225, 35, 55, 40, idex(_("3|#3")));fl_set_button_shortcut(obj, scex(_("3|#3")), 1);
|
||||
fl_set_object_lsize(obj, FL_LARGE_SIZE);
|
||||
fl_set_object_callback(obj, BulletDepthCB, 2);
|
||||
fdui->radio_bullet_depth_4 = obj = fl_add_button(FL_RADIO_BUTTON, 285, 35, 55, 40, idex(_("4|#4")));fl_set_button_shortcut(obj, scex(_("4|#4")), 1);
|
||||
fl_set_object_lsize(obj, FL_LARGE_SIZE);
|
||||
fl_set_object_callback(obj, BulletDepthCB, 3);
|
||||
fl_end_group();
|
||||
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 105, 10, 85, 20, _("Bullet Depth"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
|
||||
fdui->radio_bullet_panel = fl_bgn_group();
|
||||
fdui->radio_bullet_panel_standard = obj = fl_add_button(FL_RADIO_BUTTON, 15, 105, 65, 30, idex(_("Standard|#S")));fl_set_button_shortcut(obj, scex(_("Standard|#S")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, BulletPanelCB, 0);
|
||||
fl_set_button(obj, 1);
|
||||
fdui->radio_bullet_panel_maths = obj = fl_add_button(FL_RADIO_BUTTON, 15, 135, 65, 30, idex(_("Maths|#M")));fl_set_button_shortcut(obj, scex(_("Maths|#M")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, BulletPanelCB, 1);
|
||||
fdui->radio_bullet_panel_ding2 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 195, 65, 30, idex(_("Ding 2|#i")));fl_set_button_shortcut(obj, scex(_("Ding 2|#i")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, BulletPanelCB, 3);
|
||||
fdui->radio_bullet_panel_ding3 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 225, 65, 30, idex(_("Ding 3|#n")));fl_set_button_shortcut(obj, scex(_("Ding 3|#n")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, BulletPanelCB, 4);
|
||||
fdui->radio_bullet_panel_ding4 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 255, 65, 30, idex(_("Ding 4|#g")));fl_set_button_shortcut(obj, scex(_("Ding 4|#g")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, BulletPanelCB, 5);
|
||||
fdui->radio_bullet_panel_ding1 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 165, 65, 30, idex(_("Ding 1|#D")));fl_set_button_shortcut(obj, scex(_("Ding 1|#D")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, BulletPanelCB, 2);
|
||||
fl_end_group();
|
||||
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_bullet->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
@ -1,50 +0,0 @@
|
||||
/** Header file generated with fdesign **/
|
||||
|
||||
#ifndef FD_form_bullet_h_
|
||||
#define FD_form_bullet_h_
|
||||
|
||||
/** Callbacks, globals and object handlers **/
|
||||
extern "C" void ChoiceBulletSizeCB(FL_OBJECT *, long);
|
||||
extern "C" void BulletOKCB(FL_OBJECT *, long);
|
||||
extern "C" void BulletApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void BulletCancelCB(FL_OBJECT *, long);
|
||||
extern "C" void InputBulletLaTeXCB(FL_OBJECT *, long);
|
||||
extern "C" void BulletDepthCB(FL_OBJECT *, long);
|
||||
extern "C" void BulletPanelCB(FL_OBJECT *, long);
|
||||
extern "C" void BulletBMTableCB(FL_OBJECT *, long);
|
||||
|
||||
|
||||
/**** Additional routines ****/
|
||||
|
||||
extern void bulletForm();
|
||||
extern bool updateBulletForm();
|
||||
|
||||
/**** Forms and Objects ****/
|
||||
typedef struct {
|
||||
FL_FORM *form_bullet;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *bmtable_bullet_panel;
|
||||
FL_OBJECT *choice_bullet_size;
|
||||
FL_OBJECT *button_ok;
|
||||
FL_OBJECT *button_apply;
|
||||
FL_OBJECT *button_cancel;
|
||||
FL_OBJECT *input_bullet_latex;
|
||||
FL_OBJECT *radio_bullet_depth;
|
||||
FL_OBJECT *radio_bullet_depth_1;
|
||||
FL_OBJECT *radio_bullet_depth_2;
|
||||
FL_OBJECT *radio_bullet_depth_3;
|
||||
FL_OBJECT *radio_bullet_depth_4;
|
||||
FL_OBJECT *radio_bullet_panel;
|
||||
FL_OBJECT *radio_bullet_panel_standard;
|
||||
FL_OBJECT *radio_bullet_panel_maths;
|
||||
FL_OBJECT *radio_bullet_panel_ding2;
|
||||
FL_OBJECT *radio_bullet_panel_ding3;
|
||||
FL_OBJECT *radio_bullet_panel_ding4;
|
||||
FL_OBJECT *radio_bullet_panel_ding1;
|
||||
} FD_form_bullet;
|
||||
|
||||
extern FD_form_bullet * create_form_form_bullet(void);
|
||||
|
||||
#endif /* FD_form_bullet_h_ */
|
@ -1,246 +0,0 @@
|
||||
/* Bullet form callbacks */
|
||||
#include <config.h>
|
||||
#include <cstdlib>
|
||||
#include FORMS_H_LOCATION
|
||||
#include XPM_H_LOCATION
|
||||
#include "bullet_forms.h"
|
||||
#include "bmtable.h"
|
||||
#include "buffer.h"
|
||||
#include "bufferparams.h"
|
||||
#include "support/filetools.h"
|
||||
#include "gettext.h"
|
||||
#include "lyx_gui_misc.h" // CancelCloseBoxCB + WriteAlert
|
||||
|
||||
extern BufferView * current_view;
|
||||
FD_form_bullet * fd_form_bullet;
|
||||
|
||||
static int current_bullet_panel;
|
||||
static int current_bullet_depth;
|
||||
|
||||
/** Creates or raises the bullet popup and sets appropriate form values
|
||||
*/
|
||||
void bulletForm()
|
||||
{
|
||||
if (!fd_form_bullet) {
|
||||
if ((XpmVersion < 4
|
||||
|| (XpmVersion == 4 && XpmRevision < 7))) {
|
||||
WriteAlert(_("Sorry, your libXpm is too old."),
|
||||
_("This feature requires xpm-4.7 (a.k.a 3.4g) or newer."),
|
||||
"");
|
||||
return;
|
||||
}
|
||||
fd_form_bullet = create_form_form_bullet();
|
||||
fl_addto_choice(fd_form_bullet->choice_bullet_size,
|
||||
_(" default | tiny | script | footnote | small |"
|
||||
" normal | large | Large | LARGE | huge | Huge"));
|
||||
fl_set_choice(fd_form_bullet->choice_bullet_size, 1);
|
||||
fl_set_form_atclose(fd_form_bullet->form_bullet,
|
||||
CancelCloseBoxCB, 0);
|
||||
}
|
||||
|
||||
if (updateBulletForm()) {
|
||||
// Show form
|
||||
if (fd_form_bullet->form_bullet->visible) {
|
||||
fl_raise_form(fd_form_bullet->form_bullet);
|
||||
}
|
||||
else {
|
||||
fl_show_form(fd_form_bullet->form_bullet,
|
||||
FL_PLACE_MOUSE, FL_FULLBORDER,
|
||||
_("Itemize Bullet Selection"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool updateBulletForm()
|
||||
{
|
||||
bool update = true;
|
||||
if (!fd_form_bullet) {
|
||||
return false;
|
||||
}
|
||||
if (!current_view->available()) {
|
||||
update = false;
|
||||
} else if (current_view->buffer()->isReadonly()
|
||||
|| current_view->buffer()->isLinuxDoc()) {
|
||||
fl_deactivate_object (fd_form_bullet->button_ok);
|
||||
fl_deactivate_object (fd_form_bullet->button_apply);
|
||||
fl_set_object_lcol (fd_form_bullet->button_ok, FL_INACTIVE);
|
||||
fl_set_object_lcol (fd_form_bullet->button_apply, FL_INACTIVE);
|
||||
fl_deactivate_object (fd_form_bullet->bmtable_bullet_panel);
|
||||
fl_deactivate_object (fd_form_bullet->choice_bullet_size);
|
||||
fl_deactivate_object (fd_form_bullet->input_bullet_latex);
|
||||
update = false;
|
||||
} else {
|
||||
fl_activate_object (fd_form_bullet->button_ok);
|
||||
fl_activate_object (fd_form_bullet->button_apply);
|
||||
fl_set_object_lcol (fd_form_bullet->button_ok, FL_BLACK);
|
||||
fl_set_object_lcol (fd_form_bullet->button_apply, FL_BLACK);
|
||||
fl_activate_object (fd_form_bullet->bmtable_bullet_panel);
|
||||
fl_activate_object (fd_form_bullet->choice_bullet_size);
|
||||
fl_activate_object (fd_form_bullet->input_bullet_latex);
|
||||
}
|
||||
|
||||
if (update) {
|
||||
// any settings that need doing each time
|
||||
fl_set_button(fd_form_bullet->radio_bullet_depth_1, 1);
|
||||
fl_set_input(fd_form_bullet->input_bullet_latex,
|
||||
current_view->buffer()
|
||||
->params.user_defined_bullets[0].getText().c_str());
|
||||
fl_set_choice(fd_form_bullet->choice_bullet_size,
|
||||
current_view->buffer()
|
||||
->params.user_defined_bullets[0].getSize() + 2);
|
||||
} else {
|
||||
if (fd_form_bullet->form_bullet->visible) {
|
||||
fl_hide_form(fd_form_bullet->form_bullet);
|
||||
}
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
/*---------------------------------------*/
|
||||
/* callbacks for form form_bullet */
|
||||
|
||||
void BulletOKCB(FL_OBJECT *ob, long data)
|
||||
{
|
||||
BulletApplyCB(ob, data);
|
||||
BulletCancelCB(ob, data);
|
||||
}
|
||||
|
||||
|
||||
void BulletApplyCB(FL_OBJECT * /*ob*/, long /*data*/ )
|
||||
{
|
||||
// update the bullet settings
|
||||
BufferParams & param = current_view->buffer()->params;
|
||||
|
||||
// a little bit of loop unrolling
|
||||
param.user_defined_bullets[0] = param.temp_bullets[0];
|
||||
param.user_defined_bullets[1] = param.temp_bullets[1];
|
||||
param.user_defined_bullets[2] = param.temp_bullets[2];
|
||||
param.user_defined_bullets[3] = param.temp_bullets[3];
|
||||
current_view->buffer()->markDirty();
|
||||
}
|
||||
|
||||
|
||||
void BulletCancelCB(FL_OBJECT * /*ob*/, long /*data*/ )
|
||||
{
|
||||
fl_hide_form(fd_form_bullet->form_bullet);
|
||||
// this avoids confusion when reopening
|
||||
BufferParams & param = current_view->buffer()->params;
|
||||
param.temp_bullets[0] = param.user_defined_bullets[0];
|
||||
param.temp_bullets[1] = param.user_defined_bullets[1];
|
||||
param.temp_bullets[2] = param.user_defined_bullets[2];
|
||||
param.temp_bullets[3] = param.user_defined_bullets[3];
|
||||
}
|
||||
|
||||
|
||||
void InputBulletLaTeXCB(FL_OBJECT *, long)
|
||||
{
|
||||
// fill-in code for callback
|
||||
BufferParams & param = current_view->buffer()->params;
|
||||
|
||||
param.temp_bullets[current_bullet_depth].setText(
|
||||
fl_get_input(fd_form_bullet->input_bullet_latex));
|
||||
}
|
||||
|
||||
|
||||
void ChoiceBulletSizeCB(FL_OBJECT * ob, long /*data*/ )
|
||||
{
|
||||
BufferParams & param = current_view->buffer()->params;
|
||||
|
||||
// convert from 1-6 range to -1-4
|
||||
param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2);
|
||||
fl_set_input(fd_form_bullet->input_bullet_latex,
|
||||
param.temp_bullets[current_bullet_depth].getText().c_str());
|
||||
}
|
||||
|
||||
|
||||
void BulletDepthCB(FL_OBJECT * ob, long data)
|
||||
{
|
||||
/* Should I do the following: */
|
||||
/* 1. change to the panel that the current bullet belongs in */
|
||||
/* 2. show that bullet as selected */
|
||||
/* 3. change the size setting to the size of the bullet in Q.*/
|
||||
/* 4. display the latex equivalent in the latex box */
|
||||
/* */
|
||||
/* I'm inclined to just go with 3 and 4 at the moment and */
|
||||
/* maybe try to support the others later */
|
||||
BufferParams & param = current_view->buffer()->params;
|
||||
|
||||
switch (fl_get_button_numb(ob)) {
|
||||
case 3:
|
||||
// right mouse button resets to default
|
||||
param.temp_bullets[data] = ITEMIZE_DEFAULTS[data];
|
||||
default:
|
||||
current_bullet_depth = data;
|
||||
fl_set_input(fd_form_bullet->input_bullet_latex,
|
||||
param.temp_bullets[data].getText().c_str());
|
||||
fl_set_choice(fd_form_bullet->choice_bullet_size,
|
||||
param.temp_bullets[data].getSize() + 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BulletPanelCB(FL_OBJECT * /*ob*/, long data)
|
||||
{
|
||||
/* Here we have to change the background pixmap to that selected */
|
||||
/* by the user. (eg. standard.xpm, psnfss1.xpm etc...) */
|
||||
|
||||
if (data != current_bullet_panel) {
|
||||
fl_freeze_form(fd_form_bullet->form_bullet);
|
||||
current_bullet_panel = data;
|
||||
|
||||
/* free the current pixmap */
|
||||
fl_free_bmtable_pixmap(fd_form_bullet->bmtable_bullet_panel);
|
||||
string new_panel;
|
||||
switch (data) {
|
||||
/* display the new one */
|
||||
case 0 :
|
||||
new_panel = "standard";
|
||||
break;
|
||||
case 1 :
|
||||
new_panel = "amssymb";
|
||||
break;
|
||||
case 2 :
|
||||
new_panel = "psnfss1";
|
||||
break;
|
||||
case 3 :
|
||||
new_panel = "psnfss2";
|
||||
break;
|
||||
case 4 :
|
||||
new_panel = "psnfss3";
|
||||
break;
|
||||
case 5 :
|
||||
new_panel = "psnfss4";
|
||||
break;
|
||||
default :
|
||||
/* something very wrong happened */
|
||||
// play it safe for now but should be an exception
|
||||
current_bullet_panel = 0; // standard panel
|
||||
new_panel = "standard";
|
||||
break;
|
||||
}
|
||||
fl_set_bmtable_pixmap_file(fd_form_bullet->bmtable_bullet_panel,
|
||||
6, 6,
|
||||
LibFileSearch("images", new_panel,
|
||||
"xpm").c_str());
|
||||
fl_redraw_object(fd_form_bullet->bmtable_bullet_panel);
|
||||
fl_unfreeze_form(fd_form_bullet->form_bullet);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BulletBMTableCB(FL_OBJECT *ob, long /*data*/ )
|
||||
{
|
||||
/* handle the user input by setting the current bullet depth's pixmap */
|
||||
/* to that extracted from the current chosen position of the BMTable */
|
||||
/* Don't forget to free the button's old pixmap first. */
|
||||
|
||||
BufferParams & param = current_view->buffer()->params;
|
||||
int bmtable_button = fl_get_bmtable(ob);
|
||||
|
||||
/* try to keep the button held down till another is pushed */
|
||||
/* fl_set_bmtable(ob, 1, bmtable_button); */
|
||||
param.temp_bullets[current_bullet_depth].setFont(current_bullet_panel);
|
||||
param.temp_bullets[current_bullet_depth].setCharacter(bmtable_button);
|
||||
fl_set_input(fd_form_bullet->input_bullet_latex,
|
||||
param.temp_bullets[current_bullet_depth].getText().c_str());
|
||||
}
|
@ -10,6 +10,7 @@
|
||||
#include "support/filetools.h"
|
||||
#include "support/LRegex.h"
|
||||
#include "support/LSubstring.h"
|
||||
#include "support/lyxlib.h"
|
||||
#include "debug.h"
|
||||
|
||||
using std::ifstream;
|
||||
@ -29,7 +30,7 @@ bool CharacterSet::loadFile(string const & fname)
|
||||
// open definition file
|
||||
lyxerr[Debug::KBMAP]
|
||||
<< "Reading character set file " << fname << ".cdef" << endl;
|
||||
string filename = LibFileSearch("kbd", fname.c_str(), "cdef");
|
||||
string filename = LibFileSearch("kbd", fname, "cdef");
|
||||
ifstream ifs(filename.c_str());
|
||||
if (!ifs) {
|
||||
lyxerr << "Unable to open character set file" << endl;
|
||||
@ -48,8 +49,8 @@ bool CharacterSet::loadFile(string const & fname)
|
||||
while(getline(ifs, line)) {
|
||||
if (reg.exact_match(line)) {
|
||||
LRegex::SubMatches const & sub = reg.exec(line);
|
||||
n = atoi(line.substr(sub[1].first,
|
||||
sub[1].second).c_str());
|
||||
n = lyx::atoi(line.substr(sub[1].first,
|
||||
sub[1].second));
|
||||
str = LSubstring(line, sub[2].first, sub[2].second);
|
||||
if (lyxerr.debugging(Debug::KBMAP))
|
||||
lyxerr << "Chardef: " << n
|
||||
|
@ -12,8 +12,6 @@
|
||||
|
||||
#include <iosfwd>
|
||||
|
||||
//#define NEW_EXPORT 1
|
||||
|
||||
/** These are all the lyxfunctions (as enums).
|
||||
Please add new functions at the end of the enum, right
|
||||
before LFUN_LASTACTION.
|
||||
@ -29,15 +27,9 @@ enum kb_action {
|
||||
LFUN_MENUWRITEAS,
|
||||
LFUN_MENUPRINT,
|
||||
LFUN_MENUSENDTO,
|
||||
#ifndef NEW_EXPORT
|
||||
LFUN_RUNLATEX,
|
||||
#endif
|
||||
LFUN_BUILDPROG, // 10
|
||||
LFUN_TOCVIEW,
|
||||
LFUN_PREVIEW,
|
||||
#ifndef NEW_EXPORT
|
||||
LFUN_PREVIEWPS,
|
||||
#endif
|
||||
LFUN_CLOSEBUFFER,
|
||||
LFUN_BUFFER_PRINT, // ARRae 20000313
|
||||
LFUN_PRINTER_PARAMS_GET, // ARRae 20000313
|
||||
@ -159,9 +151,6 @@ enum kb_action {
|
||||
LFUN_LAYOUT_CHARACTER,
|
||||
LFUN_LAYOUT_PARAGRAPH,
|
||||
LFUN_LAYOUT_DOCUMENT,
|
||||
LFUN_LAYOUT_PAPER,
|
||||
LFUN_LAYOUT_TABLE,
|
||||
LFUN_LAYOUT_QUOTES,
|
||||
LFUN_LAYOUT_PREAMBLE,
|
||||
LFUN_LAYOUT_SAVE_DEFAULT,
|
||||
LFUN_DROP_LAYOUTS_CHOICE, // 140
|
||||
@ -197,9 +186,6 @@ enum kb_action {
|
||||
LFUN_BACKSPACE_SKIP, // 170
|
||||
LFUN_DELETE_SKIP,
|
||||
LFUN_MENUNEWTMPLT, // Asger 1997-02-02
|
||||
#ifndef NEW_EXPORT
|
||||
LFUN_RUNDVIPS, // Asger 1997-02-02
|
||||
#endif
|
||||
LFUN_MENURELOAD, // Asger 1997-02-02
|
||||
LFUN_FAX, // Asger 1997-02-10
|
||||
LFUN_RECONFIGURE, // Asger 1997-02-14
|
||||
@ -239,7 +225,6 @@ enum kb_action {
|
||||
LFUN_LDOTS, // Asger 970929
|
||||
LFUN_END_OF_SENTENCE, // Asger 970929
|
||||
LFUN_RUNCHKTEX, // Asger 971030
|
||||
LFUN_BUFFERBULLETSSELECT, // ARRae 971018
|
||||
LFUN_TOGGLECURSORFOLLOW, // ARRae 971202
|
||||
LFUN_HTMLURL, // CFO-G 971121
|
||||
LFUN_URL, // CFO-G 971121
|
||||
|
@ -275,7 +275,7 @@ bool Converter::Convert(Buffer * buffer, string const & from_file,
|
||||
string to_format = GetExtension(to_file);
|
||||
if (from_format == to_format)
|
||||
if (from_file != to_file)
|
||||
return lyx::rename(from_file.c_str(), to_file.c_str());
|
||||
return lyx::rename(from_file, to_file);
|
||||
else
|
||||
return true;
|
||||
|
||||
@ -408,15 +408,15 @@ bool Converter::Convert(Buffer * buffer, string const & from_file,
|
||||
"$$BaseName", from_base);
|
||||
string to = subst((*it).result_dir,
|
||||
"$$BaseName", to_base);
|
||||
return lyx::rename(from.c_str(), to.c_str());
|
||||
return lyx::rename(from, to);
|
||||
}
|
||||
|
||||
} else if (outfile != to_file)
|
||||
if ((*it).from == "tex" &&
|
||||
( (*it).to == "dvi" || (*it).to == "pdf") )
|
||||
return lyx::copy(outfile.c_str(), to_file.c_str());
|
||||
return lyx::copy(outfile, to_file);
|
||||
else
|
||||
return lyx::rename(outfile.c_str(), to_file.c_str());
|
||||
return lyx::rename(outfile, to_file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ Counters::~Counters()
|
||||
void Counters::newCounter(string const & newc)
|
||||
{
|
||||
// First check if newc already exist
|
||||
CounterList::const_iterator cit = counterList.find(newc);
|
||||
CounterList::iterator cit = counterList.find(newc);
|
||||
// if alrady exist give warning and return
|
||||
if (cit != counterList.end()) {
|
||||
lyxerr << "The new counter already exist." << endl;
|
||||
@ -90,7 +90,7 @@ void Counters::newCounter(string const & newc)
|
||||
void Counters::newCounter(string const & newc, string const & oldc)
|
||||
{
|
||||
// First check if newc already exist
|
||||
CounterList::const_iterator cit = counterList.find(newc);
|
||||
CounterList::iterator cit = counterList.find(newc);
|
||||
// if already existant give warning and return
|
||||
if (cit != counterList.end()) {
|
||||
lyxerr << "The new counter already exist." << endl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -34,7 +34,7 @@ FD_form_credits *create_form_form_credits(void)
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_credits->fdui = fdui;
|
||||
fdui->form_credits->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
@ -43,7 +43,4 @@ public:
|
||||
static
|
||||
string const BufferExtension(Buffer const * buffer);
|
||||
};
|
||||
|
||||
#define NEW_EXPORT 1
|
||||
|
||||
#endif
|
||||
|
@ -60,7 +60,6 @@ using std::sort;
|
||||
|
||||
#ifdef BROKEN_HEADERS
|
||||
extern "C" int gettimeofday(struct timeval *, struct timezone *);
|
||||
#define remove(a) unlink(a)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -183,12 +182,12 @@ LyXFileDlg * LyXFileDlg::pCurrentDlg = 0;
|
||||
void LyXFileDlg::Reread()
|
||||
{
|
||||
// Opens directory
|
||||
DIR * pDirectory = opendir(pszDirectory.c_str());
|
||||
DIR * pDirectory = ::opendir(pszDirectory.c_str());
|
||||
if (!pDirectory) {
|
||||
WriteFSAlert(_("Warning! Couldn't open directory."),
|
||||
pszDirectory);
|
||||
pszDirectory = GetCWD();
|
||||
pDirectory = opendir(pszDirectory.c_str());
|
||||
pDirectory = ::opendir(pszDirectory.c_str());
|
||||
}
|
||||
|
||||
// Clear the present namelist
|
||||
|
@ -155,10 +155,10 @@ int lyxfont::width(char const * s, int n, LyXFont const & f)
|
||||
int lyxfont::signedWidth(string const & s, LyXFont const & f)
|
||||
{
|
||||
if (s.empty()) return 0;
|
||||
if (s.c_str()[0] == '-')
|
||||
return -width(s.c_str() + 1, s.length() - 1, f);
|
||||
if (s[0] == '-')
|
||||
return -width(s.substr(1, s.length() - 1), f);
|
||||
else
|
||||
return width(s.c_str(), s.length(), f);
|
||||
return width(s, f);
|
||||
}
|
||||
|
||||
|
||||
|
46
src/form1.C
46
src/form1.C
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -21,12 +21,12 @@ FD_KeyMap *create_form_KeyMap(void)
|
||||
fdui->AcceptChset = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 280, 170, 30, idex(_("Set Charset|#C")));fl_set_button_shortcut(obj, scex(_("Set Charset|#C")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->ChsetErr = obj = fl_add_text(FL_NORMAL_TEXT, 210, 310, 170, 30, _("Charset not found!"));
|
||||
fl_set_object_lcol(obj, FL_RED);
|
||||
fl_set_object_lcolor(obj, FL_RED);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
|
||||
fdui->KeymapErr = obj = fl_add_text(FL_NORMAL_TEXT, 290, 60, 100, 90, _("Error:\n\nKeymap\nnot found"));
|
||||
fl_set_object_lcol(obj, FL_RED);
|
||||
fl_set_object_lcolor(obj, FL_RED);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
|
||||
@ -75,7 +75,7 @@ FD_KeyMap *create_form_KeyMap(void)
|
||||
fl_set_object_lalign(obj, FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->KeyMap->fdui = fdui;
|
||||
fdui->KeyMap->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -212,7 +212,7 @@ FD_Figure *create_form_Figure(void)
|
||||
fl_set_object_callback(obj, GraphicsCB, 70);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->Figure->fdui = fdui;
|
||||
fdui->Figure->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -268,39 +268,7 @@ FD_FileDlg *create_form_FileDlg(void)
|
||||
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->FileDlg->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
||||
FD_form_table *create_form_form_table(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_table *fdui = (FD_form_table *) fl_calloc(1, sizeof(FD_form_table));
|
||||
|
||||
fdui->form_table = fl_bgn_form(FL_NO_BOX, 310, 130);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, "");
|
||||
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOKCB, 0);
|
||||
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 90, 90, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableApplyCB, 0);
|
||||
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 90, 90, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableCancelCB, 0);
|
||||
fdui->slider_columns = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 50, 220, 30, _("Columns"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->slider_rows = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 10, 220, 30, _("Rows"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_table->fdui = fdui;
|
||||
fdui->FileDlg->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -349,7 +317,7 @@ FD_form_search *create_form_form_search(void)
|
||||
fl_set_object_callback(obj, SearchReplaceAllCB, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_search->fdui = fdui;
|
||||
fdui->form_search->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
17
src/form1.h
17
src/form1.h
@ -8,10 +8,6 @@
|
||||
extern "C" void GraphicsCB(FL_OBJECT *, long);
|
||||
|
||||
|
||||
extern "C" void TableOKCB(FL_OBJECT *, long);
|
||||
extern "C" void TableApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void TableCancelCB(FL_OBJECT *, long);
|
||||
|
||||
extern "C" void SearchForwardCB(FL_OBJECT *, long);
|
||||
extern "C" void SearchBackwardCB(FL_OBJECT *, long);
|
||||
extern "C" void SearchReplaceCB(FL_OBJECT *, long);
|
||||
@ -98,19 +94,6 @@ typedef struct {
|
||||
} FD_FileDlg;
|
||||
|
||||
extern FD_FileDlg * create_form_FileDlg(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_table;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *button_ok;
|
||||
FL_OBJECT *button_apply;
|
||||
FL_OBJECT *button_cancel;
|
||||
FL_OBJECT *slider_columns;
|
||||
FL_OBJECT *slider_rows;
|
||||
} FD_form_table;
|
||||
|
||||
extern FD_form_table * create_form_form_table(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_search;
|
||||
void *vdata;
|
||||
|
@ -32,10 +32,6 @@
|
||||
using std::endl;
|
||||
|
||||
extern LyXRC lyxrc;
|
||||
#ifndef NEW_EXPORT
|
||||
extern bool RunScript(Buffer * buffer, bool wait, string const & command,
|
||||
string const & orgname = string(), bool need_shell=true);
|
||||
#endif
|
||||
|
||||
#ifdef CXX_WORKING_NAMESPACES
|
||||
namespace Liason
|
||||
@ -53,9 +49,6 @@ PrinterParams getPrinterParams(Buffer * buffer)
|
||||
|
||||
bool printBuffer(Buffer * buffer, PrinterParams const & pp)
|
||||
{
|
||||
#ifndef NEW_EXPORT
|
||||
bool result(false);
|
||||
#endif
|
||||
string command(lyxrc.print_command + ' ');
|
||||
|
||||
if (pp.target == PrinterParams::PRINTER
|
||||
@ -112,7 +105,6 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp)
|
||||
|
||||
command += Converter::dvips_options(buffer) + ' ';
|
||||
|
||||
#ifdef NEW_EXPORT
|
||||
if (!Exporter::Export(buffer, "dvi", true))
|
||||
return false;
|
||||
|
||||
@ -163,57 +155,6 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp)
|
||||
break;
|
||||
}
|
||||
return res == 0;
|
||||
#else
|
||||
// Push directory path if necessary.
|
||||
// PS file should go where the source file is unless it's a
|
||||
// read-only directory in which case we write it to tmpdir.
|
||||
// All temporary files go in tmpdir (like spool files).
|
||||
string path = OnlyPath(buffer->fileName());
|
||||
if ((pp.target != PrinterParams::FILE
|
||||
&& lyxrc.use_tempdir)
|
||||
|| (IsDirWriteable(path) < 1)) {
|
||||
path = buffer->tmppath;
|
||||
}
|
||||
Path p(path);
|
||||
|
||||
// there are three cases here:
|
||||
// 1. we print to a file
|
||||
// 2. we print direct to a printer
|
||||
// 3. we print using a spool command (print to file first)
|
||||
switch (pp.target) {
|
||||
case PrinterParams::PRINTER:
|
||||
if (!lyxrc.print_spool_command.empty()) {
|
||||
// case 3
|
||||
command += lyxrc.print_to_file
|
||||
+ QuoteName(pp.file_name);
|
||||
string command2 = lyxrc.print_spool_command
|
||||
+ ' ';
|
||||
if (!pp.printer_name.empty()) {
|
||||
command2 += lyxrc.print_spool_printerprefix
|
||||
+ pp.printer_name;
|
||||
}
|
||||
// First run dvips.
|
||||
// If successful, then spool command
|
||||
if (result = RunScript(buffer, true, command)) {
|
||||
result = RunScript(buffer, false,
|
||||
command2,
|
||||
QuoteName(pp.file_name));
|
||||
}
|
||||
} else {
|
||||
// case 2
|
||||
result = RunScript(buffer, false, command);
|
||||
}
|
||||
break;
|
||||
|
||||
case PrinterParams::FILE:
|
||||
// case 1
|
||||
command += lyxrc.print_to_file
|
||||
+ QuoteName(MakeAbsPath(pp.file_name, path));
|
||||
result = RunScript(buffer, false, command);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
void setMinibuffer(LyXView * lv, char const * msg)
|
||||
|
@ -210,7 +210,7 @@ void FormDocument::build()
|
||||
fl_end_form();
|
||||
// "default" is not part of the languages array any more.
|
||||
combo_language->addto("default");
|
||||
for(Languages::const_iterator cit = languages.begin();
|
||||
for(Languages::iterator cit = languages.begin();
|
||||
cit != languages.end(); ++cit) {
|
||||
combo_language->addto((*cit).second.lang().c_str());
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ struct FD_form_error;
|
||||
|
||||
/** This class provides an XForms implementation of the FormError Dialog.
|
||||
*/
|
||||
class FormError : public FormBase, public noncopyable {
|
||||
class FormError : public FormBase {
|
||||
public:
|
||||
/// Constructor
|
||||
FormError(LyXView *, Dialogs *);
|
||||
|
@ -71,7 +71,7 @@ inline
|
||||
int string_width(string const & str)
|
||||
{
|
||||
return fl_get_string_widthTAB(FL_NORMAL_STYLE, MENU_LABEL_SIZE,
|
||||
str.c_str(), str.length());
|
||||
str.c_str(), str.length());
|
||||
}
|
||||
|
||||
//Defined later, used in set().
|
||||
|
@ -264,7 +264,7 @@ extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data)
|
||||
// What are we supposed to do with that??
|
||||
int Toolbar::get_toolbar_func(string const & func)
|
||||
{
|
||||
int action = lyxaction.LookupFunc(func.c_str());
|
||||
int action = lyxaction.LookupFunc(func);
|
||||
if (action == -1) {
|
||||
if (func == "separator"){
|
||||
action = TOOL_SEPARATOR;
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
*/
|
||||
void edit();
|
||||
/// add a new button to the toolbar.
|
||||
void add(int , bool doclean = true);
|
||||
void add(int, bool doclean = true);
|
||||
/// invokes the n'th icon in the toolbar
|
||||
void push(int);
|
||||
/// activates the toolbar
|
||||
|
@ -9,9 +9,10 @@
|
||||
###*======================================================*/
|
||||
###
|
||||
###
|
||||
### Makefile by Lars Gullik Bjønnes (larsbj@ifi.uio.no)
|
||||
### Makefile by Lars Gullik Bjønnes (larsbj@lyx.org)
|
||||
### Modified by Allan Rae <rae@lyx.org>
|
||||
### Rewritten by Angus Leeming.
|
||||
### Only update files that really have changed. (Lgb 20000924))
|
||||
|
||||
SHELL = /bin/sh
|
||||
.SUFFIXES: .fd .c
|
||||
@ -43,7 +44,9 @@ all:
|
||||
test: clean $(OBJS)
|
||||
|
||||
updatesrc: test
|
||||
mv *.C *.h ..
|
||||
for fil in *.C *.h ; do \
|
||||
cmp -s $$fil ../$$fil || mv $$fil .. \
|
||||
done
|
||||
|
||||
.fd.C:
|
||||
${SHELL} ./fdfix.sh $<
|
||||
|
@ -52,7 +52,7 @@ GraphicsCache::~GraphicsCache()
|
||||
GraphicsCacheItem *
|
||||
GraphicsCache::addFile(string const & filename)
|
||||
{
|
||||
CacheType::const_iterator it = cache.find(filename);
|
||||
CacheType::iterator it = cache.find(filename);
|
||||
|
||||
if (it != cache.end()) {
|
||||
return new GraphicsCacheItem( *((*it).second) );
|
||||
|
@ -13,8 +13,6 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include <unistd.h> // unlink
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -150,7 +148,7 @@ GraphicsCacheItem_pimpl::loadXPMImage()
|
||||
}
|
||||
|
||||
// remove the xpm file now.
|
||||
::unlink(xpmfile.c_str());
|
||||
lyx::unlink(xpmfile);
|
||||
// and remove the reference to the filename.
|
||||
xpmfile = string();
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ void kill_gs(int pid, int sig)
|
||||
if (lyxerr.debugging())
|
||||
lyxerr << "Killing gs " << pid << endl;
|
||||
lyx::kill(pid, sig);
|
||||
unlink(make_tmp(pid).c_str());
|
||||
lyx::unlink(make_tmp(pid));
|
||||
}
|
||||
|
||||
|
||||
@ -661,7 +661,7 @@ void runqueue()
|
||||
|
||||
// now chdir into dir with .eps file, to be on the safe
|
||||
// side
|
||||
::chdir(OnlyPath(p->data->fname).c_str());
|
||||
lyx::chdir(OnlyPath(p->data->fname));
|
||||
// make temp file name
|
||||
string tmpf = make_tmp(getpid());
|
||||
if (lyxerr.debugging()) {
|
||||
@ -684,7 +684,7 @@ void runqueue()
|
||||
lyxerr.debug() << "Cmd: "
|
||||
<< lyxrc.ps_command
|
||||
<< " -sDEVICE=x11 "
|
||||
<< tmpf.c_str() << ' '
|
||||
<< tmpf << ' '
|
||||
<< p->data->fname << endl;
|
||||
_exit(0); // no gs?
|
||||
}
|
||||
@ -832,7 +832,7 @@ void sigchldchecker(pid_t pid, int * status)
|
||||
p->broken = false;
|
||||
} else {
|
||||
// remove temporary files
|
||||
unlink(make_tmp(p->gspid).c_str());
|
||||
lyx::unlink(make_tmp(p->gspid));
|
||||
p->gspid = -1;
|
||||
p->broken = true;
|
||||
}
|
||||
@ -1952,7 +1952,7 @@ void InsetFig::BrowseFile()
|
||||
buf = MakeAbsPath(p, buf2);
|
||||
buf = OnlyPath(buf);
|
||||
} else {
|
||||
buf = OnlyPath(owner->fileName().c_str());
|
||||
buf = OnlyPath(owner->fileName());
|
||||
}
|
||||
|
||||
// Does user clipart directory exist?
|
||||
|
@ -349,7 +349,7 @@ void InsetBibtex::Edit(BufferView * bv, int, int, unsigned int)
|
||||
bool InsetBibtex::addDatabase(string const & db)
|
||||
{
|
||||
string contents(getContents());
|
||||
if (!contains(contents, db.c_str())) {
|
||||
if (!contains(contents, db)) {
|
||||
if (!contents.empty())
|
||||
contents += ",";
|
||||
setContents(contents + db);
|
||||
@ -361,14 +361,14 @@ bool InsetBibtex::addDatabase(string const & db)
|
||||
|
||||
bool InsetBibtex::delDatabase(string const & db)
|
||||
{
|
||||
if (contains(getContents(), db.c_str())) {
|
||||
if (contains(getContents(), db)) {
|
||||
string bd = db;
|
||||
int n = tokenPos(getContents(), ',', bd);
|
||||
if (n > 0) {
|
||||
// Weird code, would someone care to explain this?(Lgb)
|
||||
string tmp(", ");
|
||||
tmp += bd;
|
||||
setContents(subst(getContents(), tmp.c_str(), ", "));
|
||||
setContents(subst(getContents(), tmp, ", "));
|
||||
} else if (n == 0)
|
||||
setContents(split(getContents(), bd, ','));
|
||||
else
|
||||
|
@ -100,7 +100,7 @@ void InsetCollapsable::Read(Buffer const * buf, LyXLex & lex)
|
||||
int InsetCollapsable::ascent_collapsed(Painter & pain, LyXFont const &) const
|
||||
{
|
||||
int width = 0, ascent = 0, descent = 0;
|
||||
pain.buttonText(0, 0, label.c_str(), labelfont, false,
|
||||
pain.buttonText(0, 0, label, labelfont, false,
|
||||
width, ascent, descent);
|
||||
return ascent;
|
||||
}
|
||||
@ -109,7 +109,7 @@ int InsetCollapsable::ascent_collapsed(Painter & pain, LyXFont const &) const
|
||||
int InsetCollapsable::descent_collapsed(Painter & pain, LyXFont const &) const
|
||||
{
|
||||
int width = 0, ascent = 0, descent = 0;
|
||||
pain.buttonText(0, 0, label.c_str(), labelfont, false,
|
||||
pain.buttonText(0, 0, label, labelfont, false,
|
||||
width, ascent, descent);
|
||||
return descent;
|
||||
}
|
||||
@ -118,7 +118,7 @@ int InsetCollapsable::descent_collapsed(Painter & pain, LyXFont const &) const
|
||||
int InsetCollapsable::width_collapsed(Painter & pain, LyXFont const &) const
|
||||
{
|
||||
int width, ascent, descent;
|
||||
pain.buttonText(TEXT_TO_INSET_OFFSET, 0, label.c_str(), labelfont, false,
|
||||
pain.buttonText(TEXT_TO_INSET_OFFSET, 0, label, labelfont, false,
|
||||
width, ascent, descent);
|
||||
return width + (2*TEXT_TO_INSET_OFFSET);
|
||||
}
|
||||
@ -156,7 +156,7 @@ void InsetCollapsable::draw_collapsed(Painter & pain, LyXFont const &,
|
||||
{
|
||||
int width = 0;
|
||||
pain.buttonText(int(x) + TEXT_TO_INSET_OFFSET,
|
||||
baseline, label.c_str(), labelfont, true, width);
|
||||
baseline, label, labelfont, true, width);
|
||||
x += width + TEXT_TO_INSET_OFFSET;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ InsetExternal::InsetExternal()
|
||||
|
||||
InsetExternal::~InsetExternal()
|
||||
{
|
||||
remove(tempname.c_str());
|
||||
lyx::unlink(tempname);
|
||||
}
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ void InsetExternal::browseCB(FL_OBJECT * ob, long)
|
||||
buf = MakeAbsPath(p, buf2);
|
||||
buf = OnlyPath(buf);
|
||||
} else {
|
||||
buf = OnlyPath(holder->view->buffer()->fileName().c_str());
|
||||
buf = OnlyPath(holder->view->buffer()->fileName());
|
||||
}
|
||||
|
||||
fileDlg.SetButton(0, _("Document"), buf);
|
||||
@ -484,14 +484,14 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
|
||||
// Handle the $$Contents(filename) syntax
|
||||
if (contains(result, "$$Contents(\"")) {
|
||||
|
||||
int pos = result.find("$$Contents(\"");
|
||||
int end = result.find("\")", pos);
|
||||
string file = result.substr(pos + 12, end - (pos + 12));
|
||||
int const pos = result.find("$$Contents(\"");
|
||||
int const end = result.find("\")", pos);
|
||||
string const file = result.substr(pos + 12, end - (pos + 12));
|
||||
string contents;
|
||||
if (buffer) {
|
||||
// Make sure we are in the directory of the buffer
|
||||
string buf = MakeAbsPath(buffer->fileName());
|
||||
string path = OnlyPath(buf);
|
||||
string const buf = MakeAbsPath(buffer->fileName());
|
||||
string const path = OnlyPath(buf);
|
||||
Path p(path);
|
||||
contents = GetFileContents(file);
|
||||
} else {
|
||||
@ -514,7 +514,7 @@ string const InsetExternal::getCurrentTemplate() const
|
||||
|
||||
ExternalTemplate const InsetExternal::getTemplate(string const & name) const
|
||||
{
|
||||
ExternalTemplateManager::Templates::const_iterator i =
|
||||
ExternalTemplateManager::Templates::iterator i =
|
||||
ExternalTemplateManager::get().getTemplates().find(name);
|
||||
// Make sure that the template exists in the map
|
||||
if (i == ExternalTemplateManager::get().getTemplates().end()) {
|
||||
|
@ -90,9 +90,8 @@ InsetFloat::InsetFloat(string const & type)
|
||||
font.setColor(LColor::footnote);
|
||||
setLabelFont(font);
|
||||
setAutoCollapse(false);
|
||||
// setInsetName("Float");
|
||||
floatType = type;
|
||||
setInsetName(type.c_str());
|
||||
setInsetName(type);
|
||||
//floatPlacement = "H";
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ void include_cb(FL_OBJECT *, long arg)
|
||||
{
|
||||
// Should browsing too be disabled in RO-mode?
|
||||
LyXFileDlg fileDlg;
|
||||
string mpath = OnlyPath(inset->getMasterFilename());
|
||||
string const mpath = OnlyPath(inset->getMasterFilename());
|
||||
string ext;
|
||||
|
||||
if (fl_get_button(form->flag2)) // Use Input Button
|
||||
@ -117,15 +117,16 @@ void include_cb(FL_OBJECT *, long arg)
|
||||
fileDlg.SetButton(0, _("Documents"), lyxrc.document_path);
|
||||
|
||||
// Use by default the master's path
|
||||
string filename = fileDlg.Select(_("Select Child Document"),
|
||||
mpath, ext,
|
||||
inset->getContents());
|
||||
string const filename =
|
||||
fileDlg.Select(_("Select Child Document"),
|
||||
mpath, ext,
|
||||
inset->getContents());
|
||||
XFlush(fl_get_display());
|
||||
|
||||
// check selected filename
|
||||
if (!filename.empty()) {
|
||||
string filename2 = MakeRelPath(filename,
|
||||
mpath);
|
||||
string const filename2 = MakeRelPath(filename,
|
||||
mpath);
|
||||
if (prefixIs(filename2, ".."))
|
||||
fl_set_input(form->input,
|
||||
filename.c_str());
|
||||
@ -192,7 +193,7 @@ void include_cb(FL_OBJECT *, long arg)
|
||||
|
||||
static inline
|
||||
string unique_id() {
|
||||
static unsigned int seed=1000;
|
||||
static unsigned int seed = 1000;
|
||||
|
||||
std::ostringstream ost;
|
||||
ost << "file" << ++seed;
|
||||
@ -347,22 +348,20 @@ bool InsetInclude::loadIfNeeded() const
|
||||
|
||||
// the readonly flag can/will be wrong, not anymore I think.
|
||||
FileInfo finfo(getFileName());
|
||||
bool ro = !finfo.writable();
|
||||
return ( bufferlist.readFile(getFileName(), ro) != 0 );
|
||||
bool const ro = !finfo.writable();
|
||||
return bufferlist.readFile(getFileName(), ro) != 0;
|
||||
}
|
||||
|
||||
|
||||
int InsetInclude::Latex(Buffer const *, ostream & os,
|
||||
bool /*fragile*/, bool /*fs*/) const
|
||||
{
|
||||
// Do nothing if no file name has been specified
|
||||
if (getContents().empty())
|
||||
return 0;
|
||||
|
||||
// Use += to force a copy of contents (JMarc)
|
||||
// How does that force anything? (Lgb)
|
||||
string incfile(getContents());
|
||||
|
||||
// Do nothing if no file name has been specified
|
||||
if (incfile.empty())
|
||||
return 0;
|
||||
|
||||
if (loadIfNeeded()) {
|
||||
Buffer * tmp = bufferlist.getBuffer(getFileName());
|
||||
|
||||
@ -424,12 +423,12 @@ int InsetInclude::Latex(Buffer const *, ostream & os,
|
||||
|
||||
int InsetInclude::Linuxdoc(Buffer const *, ostream & os) const
|
||||
{
|
||||
// Do nothing if no file name has been specified
|
||||
if (getContents().empty())
|
||||
return 0;
|
||||
|
||||
string incfile(getContents());
|
||||
|
||||
// Do nothing if no file name has been specified
|
||||
if (incfile.empty())
|
||||
return 0;
|
||||
|
||||
if (loadIfNeeded()) {
|
||||
Buffer * tmp = bufferlist.getBuffer(getFileName());
|
||||
|
||||
@ -461,12 +460,12 @@ int InsetInclude::Linuxdoc(Buffer const *, ostream & os) const
|
||||
|
||||
int InsetInclude::DocBook(Buffer const *, ostream & os) const
|
||||
{
|
||||
// Do nothing if no file name has been specified
|
||||
if (getContents().empty())
|
||||
return 0;
|
||||
|
||||
string incfile(getContents());
|
||||
|
||||
// Do nothing if no file name has been specified
|
||||
if (incfile.empty())
|
||||
return 0;
|
||||
|
||||
if (loadIfNeeded()) {
|
||||
Buffer * tmp = bufferlist.getBuffer(getFileName());
|
||||
|
||||
@ -529,17 +528,16 @@ void InsetInclude::Validate(LaTeXFeatures & features) const
|
||||
|
||||
vector<string> const InsetInclude::getLabelList() const
|
||||
{
|
||||
vector<string> l;
|
||||
string parentname;
|
||||
vector<string> l;
|
||||
|
||||
if (loadIfNeeded()) {
|
||||
Buffer * tmp = bufferlist.getBuffer(getFileName());
|
||||
tmp->setParentName("");
|
||||
l = tmp->getLabelList();
|
||||
tmp->setParentName(getMasterFilename());
|
||||
}
|
||||
if (loadIfNeeded()) {
|
||||
Buffer * tmp = bufferlist.getBuffer(getFileName());
|
||||
tmp->setParentName("");
|
||||
l = tmp->getLabelList();
|
||||
tmp->setParentName(getMasterFilename());
|
||||
}
|
||||
|
||||
return l;
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
@ -548,9 +546,9 @@ vector<pair<string,string> > const InsetInclude::getKeys() const
|
||||
vector<pair<string,string> > keys;
|
||||
|
||||
if (loadIfNeeded()) {
|
||||
Buffer *tmp = bufferlist.getBuffer(getFileName());
|
||||
Buffer * tmp = bufferlist.getBuffer(getFileName());
|
||||
tmp->setParentName("");
|
||||
keys = tmp->getBibkeyList();
|
||||
keys = tmp->getBibkeyList();
|
||||
tmp->setParentName(getMasterFilename());
|
||||
}
|
||||
|
||||
|
@ -231,12 +231,12 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
|
||||
int nx;
|
||||
float cx;
|
||||
|
||||
UpdatableInset::draw(bv,font,baseline,x,cleared);
|
||||
UpdatableInset::draw(bv, font, baseline, x, cleared);
|
||||
if (!cleared && ((need_update == INIT) || (need_update == FULL) ||
|
||||
(top_x != int(x)) || (top_baseline != baseline))) {
|
||||
int h = ascent(bv, font) + descent(bv, font);
|
||||
int tx = display()||!owner()? 0:top_x;
|
||||
int w = tx? width(bv, font):pain.paperWidth();
|
||||
int tx = display() || !owner() ? 0 : top_x;
|
||||
int w = tx ? width(bv, font) : pain.paperWidth();
|
||||
int ty = baseline - ascent(bv, font);
|
||||
|
||||
if (ty < 0)
|
||||
@ -256,12 +256,12 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
|
||||
bool dodraw;
|
||||
x += ADD_TO_TABULAR_WIDTH;
|
||||
if (cleared || (need_update == FULL) || (need_update == CELL)) {
|
||||
for(i=0;i<tabular->rows();++i) {
|
||||
for(i = 0; i < tabular->rows(); ++i) {
|
||||
nx = int(x);
|
||||
dodraw = ((baseline+tabular->GetDescentOfRow(i)) > 0) &&
|
||||
(baseline-tabular->GetAscentOfRow(i)) < pain.paperHeight();
|
||||
for(j=0;j<tabular->columns();++j) {
|
||||
if (tabular->IsPartOfMultiColumn(i,j))
|
||||
dodraw = ((baseline + tabular->GetDescentOfRow(i)) > 0) &&
|
||||
(baseline - tabular->GetAscentOfRow(i)) < pain.paperHeight();
|
||||
for(j = 0; j < tabular->columns(); ++j) {
|
||||
if (tabular->IsPartOfMultiColumn(i, j))
|
||||
continue;
|
||||
cx = nx + tabular->GetBeginningOfTextInCell(cell);
|
||||
if (hasSelection())
|
||||
@ -274,15 +274,15 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
|
||||
if (need_update == CELL) {
|
||||
// clear before the inset
|
||||
pain.fillRectangle(
|
||||
nx+1,
|
||||
baseline - tabular->GetAscentOfRow(i)+1,
|
||||
cx - nx - 1,
|
||||
nx + 1,
|
||||
baseline - tabular->GetAscentOfRow(i) + 1,
|
||||
int(cx - nx - 1),
|
||||
tabular->GetAscentOfRow(i) +
|
||||
tabular->GetDescentOfRow(i) - 1);
|
||||
// clear behind the inset
|
||||
pain.fillRectangle(
|
||||
cx + the_locking_inset->width(bv,font) + 1,
|
||||
baseline - tabular->GetAscentOfRow(i)+1,
|
||||
int(cx + the_locking_inset->width(bv,font) + 1),
|
||||
baseline - tabular->GetAscentOfRow(i) + 1,
|
||||
tabular->GetWidthOfColumn(cell) -
|
||||
tabular->GetBeginningOfTextInCell(cell) -
|
||||
the_locking_inset->width(bv,font) - 1,
|
||||
@ -302,8 +302,8 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
|
||||
++cell;
|
||||
}
|
||||
baseline += tabular->GetDescentOfRow(i) +
|
||||
tabular->GetAscentOfRow(i+1)+
|
||||
tabular->GetAdditionalHeight(cell+1);
|
||||
tabular->GetAscentOfRow(i + 1) +
|
||||
tabular->GetAdditionalHeight(cell + 1);
|
||||
}
|
||||
}
|
||||
x -= ADD_TO_TABULAR_WIDTH;
|
||||
@ -325,28 +325,28 @@ void InsetTabular::DrawCellLines(Painter & pain, int x, int baseline,
|
||||
on_off = !tabular->TopLine(cell);
|
||||
pain.line(x, baseline - tabular->GetAscentOfRow(row),
|
||||
x2, baseline - tabular->GetAscentOfRow(row),
|
||||
on_off ? LColor::tabularonoffline:LColor::tabularline,
|
||||
on_off ? Painter::line_onoffdash:Painter::line_solid);
|
||||
on_off ? LColor::tabularonoffline : LColor::tabularline,
|
||||
on_off ? Painter::line_onoffdash : Painter::line_solid);
|
||||
}
|
||||
on_off = !tabular->BottomLine(cell);
|
||||
pain.line(x,baseline + tabular->GetDescentOfRow(row),
|
||||
x2, baseline + tabular->GetDescentOfRow(row),
|
||||
on_off ? LColor::tabularonoffline:LColor::tabularline,
|
||||
on_off ? Painter::line_onoffdash:Painter::line_solid);
|
||||
on_off ? LColor::tabularonoffline : LColor::tabularline,
|
||||
on_off ? Painter::line_onoffdash : Painter::line_solid);
|
||||
if (!tabular->LeftAlreadyDrawed(cell)) {
|
||||
on_off = !tabular->LeftLine(cell);
|
||||
pain.line(x, baseline - tabular->GetAscentOfRow(row),
|
||||
x, baseline + tabular->GetDescentOfRow(row),
|
||||
on_off ? LColor::tabularonoffline:LColor::tabularline,
|
||||
on_off ? Painter::line_onoffdash:Painter::line_solid);
|
||||
on_off ? LColor::tabularonoffline : LColor::tabularline,
|
||||
on_off ? Painter::line_onoffdash : Painter::line_solid);
|
||||
}
|
||||
on_off = !tabular->RightLine(cell);
|
||||
pain.line(x2 - tabular->GetAdditionalWidth(cell),
|
||||
baseline - tabular->GetAscentOfRow(row),
|
||||
x2 - tabular->GetAdditionalWidth(cell),
|
||||
baseline + tabular->GetDescentOfRow(row),
|
||||
on_off ? LColor::tabularonoffline:LColor::tabularline,
|
||||
on_off ? Painter::line_onoffdash:Painter::line_solid);
|
||||
on_off ? LColor::tabularonoffline : LColor::tabularline,
|
||||
on_off ? Painter::line_onoffdash : Painter::line_solid);
|
||||
}
|
||||
|
||||
|
||||
@ -443,7 +443,7 @@ void InsetTabular::InsetUnlock(BufferView * bv)
|
||||
locked = false;
|
||||
if (scroll() || hasSelection()) {
|
||||
if (scroll()) {
|
||||
scroll(bv, (float)0.0);
|
||||
scroll(bv, 0.0F);
|
||||
} else {
|
||||
sel_pos_start = sel_pos_end = 0;
|
||||
sel_cell_start = sel_cell_end = 0;
|
||||
@ -457,6 +457,7 @@ void InsetTabular::UpdateLocal(BufferView * bv, UpdateCodes what,
|
||||
bool mark_dirty) const
|
||||
{
|
||||
need_update = what;
|
||||
// Dirty Cast! (Lgb)
|
||||
bv->updateInset(const_cast<InsetTabular *>(this), mark_dirty);
|
||||
if (locked && (what != NONE))
|
||||
resetPos(bv);
|
||||
@ -509,11 +510,11 @@ bool InsetTabular::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
|
||||
return true;
|
||||
}
|
||||
if (the_locking_inset->UnlockInsetInInset(bv, inset, lr)) {
|
||||
if ((inset->LyxCode() == TABULAR_CODE) &&
|
||||
if (inset->LyxCode() == TABULAR_CODE &&
|
||||
!the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE))
|
||||
{
|
||||
dialogs_ = bv->owner()->getDialogs();
|
||||
dialogs_->updateTabular(const_cast<InsetTabular *>(this));
|
||||
dialogs_->updateTabular(this);
|
||||
oldcell = actcell;
|
||||
}
|
||||
return true;
|
||||
@ -574,8 +575,8 @@ void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button)
|
||||
}
|
||||
no_selection = false;
|
||||
|
||||
int ocell = actcell;
|
||||
int orow = actrow;
|
||||
int const ocell = actcell;
|
||||
int const orow = actrow;
|
||||
|
||||
HideInsetCursor(bv);
|
||||
setPos(bv, x, y);
|
||||
@ -584,10 +585,11 @@ void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button)
|
||||
sel_pos_start = sel_pos_end = cursor.pos();
|
||||
sel_cell_start = sel_cell_end = actcell;
|
||||
|
||||
bool inset_hit = InsetHit(bv, x, y);
|
||||
bool const inset_hit = InsetHit(bv, x, y);
|
||||
|
||||
if ((ocell == actcell) && the_locking_inset && inset_hit) {
|
||||
the_locking_inset->InsetButtonPress(bv, x-inset_x, y-inset_y, button);
|
||||
the_locking_inset->InsetButtonPress(bv,
|
||||
x - inset_x, y - inset_y, button);
|
||||
return;
|
||||
} else if (the_locking_inset) {
|
||||
the_locking_inset->InsetUnlock(bv);
|
||||
@ -595,8 +597,8 @@ void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button)
|
||||
the_locking_inset = 0;
|
||||
if (inset_hit && bv->the_locking_inset) {
|
||||
if (ActivateCellInset(bv, x, y, button))
|
||||
the_locking_inset->InsetButtonPress(bv, x-inset_x,
|
||||
y-inset_y, button);
|
||||
the_locking_inset->InsetButtonPress(bv, x - inset_x,
|
||||
y - inset_y, button);
|
||||
return;
|
||||
}
|
||||
ShowInsetCursor(bv);
|
||||
@ -635,8 +637,8 @@ void InsetTabular::InsetMotionNotify(BufferView * bv, int x, int y, int button)
|
||||
}
|
||||
if (!no_selection) {
|
||||
HideInsetCursor(bv);
|
||||
int old_pos = sel_pos_end;
|
||||
int old_cell = actcell;
|
||||
int const old_pos = sel_pos_end;
|
||||
int const old_cell = actcell;
|
||||
|
||||
setPos(bv, x, y);
|
||||
sel_pos_end = cursor.pos();
|
||||
@ -752,7 +754,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
|
||||
break;
|
||||
case LFUN_DOWNSEL:
|
||||
{
|
||||
int ocell = actcell;
|
||||
int const ocell = actcell;
|
||||
moveDown(bv);
|
||||
sel_pos_end = cursor.pos();
|
||||
if ((ocell == sel_cell_end) ||
|
||||
@ -764,7 +766,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
|
||||
}
|
||||
break;
|
||||
case LFUN_DOWN:
|
||||
result= moveDown(bv);
|
||||
result = moveDown(bv);
|
||||
sel_pos_start = sel_pos_end = cursor.pos();
|
||||
sel_cell_start = sel_cell_end = actcell;
|
||||
if (hs)
|
||||
@ -772,7 +774,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
|
||||
break;
|
||||
case LFUN_UPSEL:
|
||||
{
|
||||
int ocell = actcell;
|
||||
int const ocell = actcell;
|
||||
moveUp(bv);
|
||||
sel_pos_end = cursor.pos();
|
||||
if ((ocell == sel_cell_end) ||
|
||||
@ -784,7 +786,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
|
||||
}
|
||||
break;
|
||||
case LFUN_UP:
|
||||
result= moveUp(bv);
|
||||
result = moveUp(bv);
|
||||
sel_pos_start = sel_pos_end = cursor.pos();
|
||||
sel_cell_start = sel_cell_end = actcell;
|
||||
if (hs)
|
||||
@ -813,12 +815,22 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
|
||||
if (hs)
|
||||
UpdateLocal(bv, SELECTION, false);
|
||||
break;
|
||||
#if 0
|
||||
case LFUN_LAYOUT_TABLE:
|
||||
{
|
||||
dialogs_ = bv->owner()->getDialogs();
|
||||
dialogs_->showTabular(this);
|
||||
}
|
||||
break;
|
||||
#else
|
||||
#warning Jürgen, have a look. Is this correct? (Lgb)
|
||||
case LFUN_LAYOUT_TABULAR:
|
||||
{
|
||||
dialogs_ = bv->owner()->getDialogs();
|
||||
dialogs_->showTabular(this);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case LFUN_TABULAR_FEATURE:
|
||||
if (!TabularFeatures(bv, arg))
|
||||
result = UNDISPATCHED;
|
||||
@ -954,8 +966,8 @@ void InsetTabular::ToggleInsetCursor(BufferView * bv)
|
||||
|
||||
LyXFont font; // = the_locking_inset->GetFont(par, cursor.pos);
|
||||
|
||||
int asc = lyxfont::maxAscent(font);
|
||||
int desc = lyxfont::maxDescent(font);
|
||||
int const asc = lyxfont::maxAscent(font);
|
||||
int const desc = lyxfont::maxDescent(font);
|
||||
|
||||
if (cursor_visible)
|
||||
bv->hideLockedInsetCursor();
|
||||
@ -970,8 +982,8 @@ void InsetTabular::ShowInsetCursor(BufferView * bv)
|
||||
if (!cursor_visible) {
|
||||
LyXFont font; // = GetFont(par, cursor.pos);
|
||||
|
||||
int asc = lyxfont::maxAscent(font);
|
||||
int desc = lyxfont::maxDescent(font);
|
||||
int const asc = lyxfont::maxAscent(font);
|
||||
int const desc = lyxfont::maxDescent(font);
|
||||
bv->fitLockedInsetCursor(cursor.x(), cursor.y(), asc, desc);
|
||||
bv->showLockedInsetCursor(cursor.x(), cursor.y(), asc, desc);
|
||||
cursor_visible = true;
|
||||
@ -1017,7 +1029,7 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
|
||||
tabular->GetAdditionalWidth(actcell - 1));
|
||||
cursor.pos(0);
|
||||
resetPos(bv);
|
||||
if ((lx - (tabular->GetWidthOfColumn(actcell)/2)) < x) {
|
||||
if ((lx - (tabular->GetWidthOfColumn(actcell) / 2)) < x) {
|
||||
cursor.x(lx + top_x - 2);
|
||||
cursor.pos(1);
|
||||
} else {
|
||||
@ -1029,9 +1041,9 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
|
||||
|
||||
int InsetTabular::getCellXPos(int cell) const
|
||||
{
|
||||
int c;
|
||||
int c = cell;
|
||||
|
||||
for(c=cell;!tabular->IsFirstCellInRow(c);--c)
|
||||
for(; !tabular->IsFirstCellInRow(c); --c)
|
||||
;
|
||||
int lx = tabular->GetWidthOfColumn(cell);
|
||||
for(; (c < cell); ++c) {
|
||||
@ -1050,7 +1062,7 @@ void InsetTabular::resetPos(BufferView * bv) const
|
||||
int cell = 0;
|
||||
actrow = 0;
|
||||
cursor.y(0);
|
||||
for(; (cell<actcell) && !tabular->IsLastRow(cell); ++cell) {
|
||||
for(; (cell < actcell) && !tabular->IsLastRow(cell); ++cell) {
|
||||
if (tabular->IsLastCellInRow(cell)) {
|
||||
cursor.y(cursor.y() + tabular->GetDescentOfRow(actrow) +
|
||||
tabular->GetAscentOfRow(actrow + 1) +
|
||||
@ -1058,7 +1070,7 @@ void InsetTabular::resetPos(BufferView * bv) const
|
||||
++actrow;
|
||||
}
|
||||
}
|
||||
static int offset = ADD_TO_TABULAR_WIDTH + 2;
|
||||
static int const offset = ADD_TO_TABULAR_WIDTH + 2;
|
||||
cursor.x(getCellXPos(actcell) + offset);
|
||||
if (((cursor.x() - offset) > 20) &&
|
||||
((cursor.x()-offset+tabular->GetWidthOfColumn(actcell)) >
|
||||
@ -1123,7 +1135,7 @@ UpdatableInset::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock)
|
||||
|
||||
UpdatableInset::RESULT InsetTabular::moveUp(BufferView * bv)
|
||||
{
|
||||
int ocell = actcell;
|
||||
int const ocell = actcell;
|
||||
actcell = tabular->GetCellAbove(actcell);
|
||||
if (actcell == ocell) // we moved out of the inset
|
||||
return FINISHED;
|
||||
@ -1134,7 +1146,7 @@ UpdatableInset::RESULT InsetTabular::moveUp(BufferView * bv)
|
||||
|
||||
UpdatableInset::RESULT InsetTabular::moveDown(BufferView * bv)
|
||||
{
|
||||
int ocell = actcell;
|
||||
int const ocell = actcell;
|
||||
actcell = tabular->GetCellBelow(actcell);
|
||||
if (actcell == ocell) // we moved out of the inset
|
||||
return FINISHED;
|
||||
@ -1182,15 +1194,17 @@ void InsetTabular::SetFont(BufferView * bv, LyXFont const & font, bool tall)
|
||||
}
|
||||
|
||||
|
||||
bool InsetTabular::TabularFeatures(BufferView * bv, string what)
|
||||
bool InsetTabular::TabularFeatures(BufferView * bv, string const & what)
|
||||
{
|
||||
int action = LyXTabular::LAST_ACTION;
|
||||
string val;
|
||||
int i;
|
||||
|
||||
for(i=0; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
|
||||
if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(),
|
||||
tabularFeatures[i].feature.length())) {
|
||||
int i = 0;
|
||||
for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
|
||||
string const tmp = tabularFeatures[i].feature;
|
||||
|
||||
if (tmp == what.substr(0, tmp.length())) {
|
||||
//if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(),
|
||||
//tabularFeatures[i].feature.length())) {
|
||||
action = tabularFeatures[i].action;
|
||||
break;
|
||||
}
|
||||
@ -1198,13 +1212,15 @@ bool InsetTabular::TabularFeatures(BufferView * bv, string what)
|
||||
if (action == LyXTabular::LAST_ACTION)
|
||||
return false;
|
||||
|
||||
val = frontStrip(what.substr(tabularFeatures[i].feature.length()));
|
||||
string const val =
|
||||
frontStrip(what.substr(tabularFeatures[i].feature.length()));
|
||||
TabularFeatures(bv, action, val);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
|
||||
void InsetTabular::TabularFeatures(BufferView * bv, int feature,
|
||||
string const & value)
|
||||
{
|
||||
int
|
||||
i, j,
|
||||
@ -1246,7 +1262,6 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
|
||||
break;
|
||||
}
|
||||
if (hasSelection()) {
|
||||
int tmp;
|
||||
sel_col_start = tabular->column_of_cell(sel_cell_start);
|
||||
sel_col_end = tabular->column_of_cell(sel_cell_end);
|
||||
if (sel_col_start > sel_col_end) {
|
||||
@ -1259,9 +1274,10 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
|
||||
sel_row_start = tabular->row_of_cell(sel_cell_start);
|
||||
sel_row_end = tabular->row_of_cell(sel_cell_end);
|
||||
if (sel_row_start > sel_row_end) {
|
||||
tmp = sel_row_start;
|
||||
sel_row_start = sel_row_end;
|
||||
sel_row_end = tmp;
|
||||
//int tmp = sel_row_start;
|
||||
//sel_row_start = sel_row_end;
|
||||
//sel_row_end = tmp;
|
||||
swap(sel_row_start, sel_row_end);
|
||||
}
|
||||
} else {
|
||||
sel_col_start = sel_col_end = tabular->column_of_cell(actcell);
|
||||
@ -1284,7 +1300,7 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
|
||||
switch (feature) {
|
||||
case LyXTabular::SET_PWIDTH:
|
||||
{
|
||||
bool update = (tabular->GetColumnPWidth(actcell) != value);
|
||||
bool const update = (tabular->GetColumnPWidth(actcell) != value);
|
||||
tabular->SetColumnPWidth(actcell,value);
|
||||
if (update) {
|
||||
for (int i=0; i < tabular->rows(); ++i) {
|
||||
@ -1297,7 +1313,7 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
|
||||
break;
|
||||
case LyXTabular::SET_MPWIDTH:
|
||||
{
|
||||
bool update = (tabular->GetPWidth(actcell) != value);
|
||||
bool const update = (tabular->GetPWidth(actcell) != value);
|
||||
tabular->SetMColumnPWidth(actcell,value);
|
||||
if (update) {
|
||||
for (int i=0; i < tabular->rows(); ++i) {
|
||||
@ -1434,8 +1450,8 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
|
||||
}
|
||||
// we have a selection so this means we just add all this
|
||||
// cells to form a multicolumn cell
|
||||
int
|
||||
s_start, s_end;
|
||||
int s_start;
|
||||
int s_end;
|
||||
|
||||
if (sel_cell_start > sel_cell_end) {
|
||||
s_start = sel_cell_end;
|
||||
@ -1480,36 +1496,35 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
|
||||
tabular->SetRotateCell(tabular->GetCellNumber(i,j),true);
|
||||
break;
|
||||
case LyXTabular::UNSET_ROTATE_CELL:
|
||||
for(i=sel_row_start; i<=sel_row_end; ++i)
|
||||
for(j=sel_col_start; j<=sel_col_end; ++j)
|
||||
tabular->SetRotateCell(tabular->GetCellNumber(i,j),false);
|
||||
for(i = sel_row_start; i <= sel_row_end; ++i)
|
||||
for(j = sel_col_start; j <= sel_col_end; ++j)
|
||||
tabular->SetRotateCell(tabular->GetCellNumber(i, j), false);
|
||||
break;
|
||||
case LyXTabular::SET_USEBOX:
|
||||
{
|
||||
LyXTabular::BoxType val = static_cast<LyXTabular::BoxType>
|
||||
(strToInt(value));
|
||||
LyXTabular::BoxType val = LyXTabular::BoxType(strToInt(value));
|
||||
if (val == tabular->GetUsebox(actcell))
|
||||
val = LyXTabular::BOX_NONE;
|
||||
for(i=sel_row_start; i<=sel_row_end; ++i)
|
||||
for(j=sel_col_start; j<=sel_col_end; ++j)
|
||||
tabular->SetUsebox(tabular->GetCellNumber(i,j),val);
|
||||
for(i = sel_row_start; i <= sel_row_end; ++i)
|
||||
for(j = sel_col_start; j <= sel_col_end; ++j)
|
||||
tabular->SetUsebox(tabular->GetCellNumber(i, j), val);
|
||||
break;
|
||||
}
|
||||
case LyXTabular::SET_LTFIRSTHEAD:
|
||||
tabular->SetLTHead(actcell,true);
|
||||
tabular->SetLTHead(actcell, true);
|
||||
break;
|
||||
case LyXTabular::SET_LTHEAD:
|
||||
tabular->SetLTHead(actcell,false);
|
||||
tabular->SetLTHead(actcell, false);
|
||||
break;
|
||||
case LyXTabular::SET_LTFOOT:
|
||||
tabular->SetLTFoot(actcell,false);
|
||||
tabular->SetLTFoot(actcell, false);
|
||||
break;
|
||||
case LyXTabular::SET_LTLASTFOOT:
|
||||
tabular->SetLTFoot(actcell,true);
|
||||
tabular->SetLTFoot(actcell, true);
|
||||
break;
|
||||
case LyXTabular::SET_LTNEWPAGE:
|
||||
what = !tabular->GetLTNewPage(actcell);
|
||||
tabular->SetLTNewPage(actcell,what);
|
||||
tabular->SetLTNewPage(actcell, what);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1562,20 +1577,20 @@ bool InsetTabular::InsetHit(BufferView * bv, int x, int ) const
|
||||
// in pixels if we have a pwidth for this cell.
|
||||
int InsetTabular::GetMaxWidthOfCell(Painter &, int cell) const
|
||||
{
|
||||
string s = tabular->GetPWidth(cell);
|
||||
string const s = tabular->GetPWidth(cell);
|
||||
|
||||
if (s.empty())
|
||||
return -1;
|
||||
return VSpace(s).inPixels( 0, 0);
|
||||
return VSpace(s).inPixels(0, 0);
|
||||
}
|
||||
|
||||
|
||||
int InsetTabular::getMaxWidth(Painter & pain,
|
||||
UpdatableInset const * inset) const
|
||||
{
|
||||
int cell;
|
||||
int n = tabular->GetNumberOfCells();
|
||||
for(cell=0; cell < n; ++cell) {
|
||||
int const n = tabular->GetNumberOfCells();
|
||||
int cell = 0;
|
||||
for(; cell < n; ++cell) {
|
||||
if (tabular->GetCellInset(cell) == inset)
|
||||
break;
|
||||
}
|
||||
@ -1594,6 +1609,7 @@ void InsetTabular::resizeLyXText(BufferView *) const
|
||||
need_update = FULL;
|
||||
}
|
||||
|
||||
|
||||
LyXText * InsetTabular::getLyXText(BufferView * bv) const
|
||||
{
|
||||
if (the_locking_inset)
|
||||
@ -1623,16 +1639,17 @@ void InsetTabular::OpenLayoutDialog(BufferView * bv) const
|
||||
// 2 ... toggled on
|
||||
// 3 ... toggled off
|
||||
//
|
||||
LyXFunc::func_status InsetTabular::getStatus(string what) const
|
||||
LyXFunc::func_status InsetTabular::getStatus(string const & what) const
|
||||
{
|
||||
int action = LyXTabular::LAST_ACTION;
|
||||
string argument;
|
||||
int i;
|
||||
LyXFunc::func_status status = LyXFunc::OK;
|
||||
|
||||
for(i=0; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
|
||||
if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(),
|
||||
tabularFeatures[i].feature.length())) {
|
||||
int i = 0;
|
||||
for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
|
||||
string const tmp = tabularFeatures[i].feature;
|
||||
if (tmp == what.substr(0, tmp.length())) {
|
||||
//if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(),
|
||||
// tabularFeatures[i].feature.length())) {
|
||||
action = tabularFeatures[i].action;
|
||||
break;
|
||||
}
|
||||
@ -1640,20 +1657,20 @@ LyXFunc::func_status InsetTabular::getStatus(string what) const
|
||||
if (action == LyXTabular::LAST_ACTION)
|
||||
return LyXFunc::Unknown;
|
||||
|
||||
argument = frontStrip(what.substr(tabularFeatures[i].feature.length()));
|
||||
string const argument = frontStrip(what.substr(tabularFeatures[i].feature.length()));
|
||||
|
||||
int sel_row_start, sel_row_end;
|
||||
int dummy;
|
||||
bool flag = true;
|
||||
|
||||
if (hasSelection()) {
|
||||
int tmp;
|
||||
sel_row_start = tabular->row_of_cell(sel_cell_start);
|
||||
sel_row_end = tabular->row_of_cell(sel_cell_end);
|
||||
if (sel_row_start > sel_row_end) {
|
||||
tmp = sel_row_start;
|
||||
sel_row_start = sel_row_end;
|
||||
sel_row_end = tmp;
|
||||
//int tmp = sel_row_start;
|
||||
//sel_row_start = sel_row_end;
|
||||
//sel_row_end = tmp;
|
||||
swap(sel_row_start, sel_row_end);
|
||||
}
|
||||
} else {
|
||||
sel_row_start = sel_row_end = tabular->row_of_cell(actcell);
|
||||
@ -1864,21 +1881,22 @@ bool InsetTabular::copySelection()
|
||||
sel_row_start = tabular->row_of_cell(sel_cell_start);
|
||||
sel_row_end = tabular->row_of_cell(sel_cell_end);
|
||||
if (sel_row_start > sel_row_end) {
|
||||
int tmp;
|
||||
tmp = sel_row_start;
|
||||
sel_row_start = sel_row_end;
|
||||
sel_row_end = tmp;
|
||||
//int tmp tmp = sel_row_start;
|
||||
//sel_row_start = sel_row_end;
|
||||
//sel_row_end = tmp;
|
||||
swap(sel_row_start, sel_row_end);
|
||||
}
|
||||
int rows = sel_row_end - sel_row_start + 1;
|
||||
|
||||
paste_tabular = new LyXTabular(this, rows, columns);
|
||||
|
||||
if (sel_cell_start > sel_cell_end) {
|
||||
int tmp = sel_cell_start;
|
||||
sel_cell_start = sel_cell_end;
|
||||
sel_cell_end = tmp;
|
||||
//int tmp = sel_cell_start;
|
||||
//sel_cell_start = sel_cell_end;
|
||||
//sel_cell_end = tmp;
|
||||
swap(sel_cell_start, sel_cell_end);
|
||||
}
|
||||
for(int i=sel_cell_start, j=0; i <= sel_cell_end; ++i, ++j) {
|
||||
for(int i = sel_cell_start, j = 0; i <= sel_cell_end; ++i, ++j) {
|
||||
while(paste_tabular->row_of_cell(j) <
|
||||
(tabular->row_of_cell(i)-sel_row_start)) {
|
||||
++j;
|
||||
@ -1933,19 +1951,19 @@ bool InsetTabular::cutSelection()
|
||||
sel_row_start = tabular->row_of_cell(sel_cell_start);
|
||||
sel_row_end = tabular->row_of_cell(sel_cell_end);
|
||||
if (sel_row_start > sel_row_end) {
|
||||
int tmp;
|
||||
tmp = sel_row_start;
|
||||
sel_row_start = sel_row_end;
|
||||
sel_row_end = tmp;
|
||||
//int tmp = sel_row_start;
|
||||
//sel_row_start = sel_row_end;
|
||||
//sel_row_end = tmp;
|
||||
swap(sel_row_start, sel_row_end);
|
||||
}
|
||||
if (sel_cell_start > sel_cell_end) {
|
||||
int tmp = sel_cell_start;
|
||||
sel_cell_start = sel_cell_end;
|
||||
sel_cell_end = tmp;
|
||||
//int tmp = sel_cell_start;
|
||||
//sel_cell_start = sel_cell_end;
|
||||
//sel_cell_end = tmp;
|
||||
swap(sel_cell_start, sel_cell_end);
|
||||
}
|
||||
int i, j;
|
||||
for(i=sel_row_start; i <= sel_row_end; ++i) {
|
||||
for(j=sel_col_start; j <= sel_col_end; ++j) {
|
||||
for(int i = sel_row_start; i <= sel_row_end; ++i) {
|
||||
for(int j = sel_col_start; j <= sel_col_end; ++j) {
|
||||
tabular->GetCellInset(tabular->GetCellNumber(i, j))->clear();
|
||||
}
|
||||
}
|
||||
|
@ -149,11 +149,12 @@ public:
|
||||
///
|
||||
void ToggleInsetCursor(BufferView *);
|
||||
///
|
||||
bool TabularFeatures(BufferView * bv, string what);
|
||||
bool TabularFeatures(BufferView * bv, string const & what);
|
||||
///
|
||||
void TabularFeatures(BufferView * bv, int feature, string val = string());
|
||||
void TabularFeatures(BufferView * bv, int feature,
|
||||
string const & val = string());
|
||||
///
|
||||
int GetActCell() { return actcell; }
|
||||
int GetActCell() const { return actcell; }
|
||||
///
|
||||
void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
|
||||
///
|
||||
@ -162,9 +163,12 @@ public:
|
||||
Buffer * BufferOwner() const { return buffer; }
|
||||
///
|
||||
LyXText * getLyXText(BufferView *) const;
|
||||
///
|
||||
void resizeLyXText(BufferView *) const;
|
||||
///
|
||||
void OpenLayoutDialog(BufferView *) const;
|
||||
LyXFunc::func_status getStatus(string argument) const;
|
||||
///
|
||||
LyXFunc::func_status getStatus(string const & argument) const;
|
||||
|
||||
//
|
||||
// Public structures and variables
|
||||
@ -174,7 +178,7 @@ public:
|
||||
private:
|
||||
///
|
||||
bool calculate_dimensions_of_cells(BufferView *, LyXFont const &,
|
||||
bool =false) const;
|
||||
bool = false) const;
|
||||
///
|
||||
void DrawCellLines(Painter &, int x, int baseline,
|
||||
int row, int cell) const;
|
||||
@ -208,7 +212,7 @@ private:
|
||||
///
|
||||
void RemoveTabularRow();
|
||||
///
|
||||
bool hasSelection() const {return ((sel_pos_start != sel_pos_end) ||
|
||||
bool hasSelection() const { return ((sel_pos_start != sel_pos_end) ||
|
||||
(sel_cell_start != sel_cell_end));}
|
||||
///
|
||||
bool ActivateCellInset(BufferView *, int x = 0, int y = 0, int button = 0,
|
||||
|
@ -107,12 +107,19 @@ public:
|
||||
};
|
||||
|
||||
///
|
||||
enum { TEXT_TO_INSET_OFFSET = 2 };
|
||||
enum {
|
||||
///
|
||||
TEXT_TO_INSET_OFFSET = 2
|
||||
};
|
||||
|
||||
///
|
||||
enum EDITABLE {
|
||||
NOT_EDITABLE = 0,
|
||||
IS_EDITABLE,
|
||||
HIGHLY_EDITABLE
|
||||
///
|
||||
NOT_EDITABLE = 0,
|
||||
///
|
||||
IS_EDITABLE,
|
||||
///
|
||||
HIGHLY_EDITABLE
|
||||
};
|
||||
|
||||
///
|
||||
@ -198,25 +205,28 @@ public:
|
||||
///
|
||||
virtual bool InsertInsetAllowed(Inset *) const { return false; }
|
||||
///
|
||||
virtual void setInsetName(const char * s) { name = s; }
|
||||
void setInsetName(string const & s) { name = s; }
|
||||
///
|
||||
virtual string getInsetName() const { return name; }
|
||||
string const getInsetName() const { return name; }
|
||||
///
|
||||
virtual void setOwner(Inset * inset) { owner_ = inset; }
|
||||
void setOwner(Inset * inset) { owner_ = inset; }
|
||||
///
|
||||
virtual Inset * owner() const { return owner_; }
|
||||
Inset * owner() const { return owner_; }
|
||||
///
|
||||
int x() const { return top_x; }
|
||||
///
|
||||
int y() const { return top_baseline; }
|
||||
//
|
||||
// because we could have fake text insets and have to call this
|
||||
// inside them without cast!!!
|
||||
///
|
||||
/// because we could have fake text insets and have to call this
|
||||
/// inside them without cast!!!
|
||||
virtual LyXText * getLyXText(BufferView *) const;
|
||||
virtual void deleteLyXText(BufferView *, bool =true) const {}
|
||||
///
|
||||
virtual void deleteLyXText(BufferView *, bool = true) const {}
|
||||
///
|
||||
virtual void resizeLyXText(BufferView *) const {}
|
||||
// returns the actuall scroll-value
|
||||
int scroll() const { return scx; }
|
||||
/// returns the actuall scroll-value
|
||||
int scroll() const { return scx; }
|
||||
|
||||
protected:
|
||||
///
|
||||
|
@ -100,7 +100,7 @@ int kb_sequence::parse(string const & s)
|
||||
{
|
||||
if(s.empty()) return 1;
|
||||
|
||||
int i = 0;
|
||||
string::size_type i = 0;
|
||||
unsigned int mod = 0, nmod = 0;
|
||||
while (i < s.length()) {
|
||||
if(s[i] && (s[i]) <= ' ') ++i;
|
||||
@ -142,7 +142,7 @@ int kb_sequence::parse(string const & s)
|
||||
}
|
||||
} else {
|
||||
string tbuf;
|
||||
int j = i;
|
||||
string::size_type j = i;
|
||||
for(; j < s.length() && s[j] > ' '; ++j)
|
||||
tbuf += s[j]; // (!!!check bounds :-)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -9,188 +9,6 @@
|
||||
#include <cstdlib>
|
||||
#include "layout_forms.h"
|
||||
|
||||
FD_form_document *create_form_form_document(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_document *fdui = (FD_form_document *) fl_calloc(1, sizeof(FD_form_document));
|
||||
|
||||
fdui->form_document = fl_bgn_form(FL_NO_BOX, 580, 430);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 580, 430, "");
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 290, 110, 120, 70, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 300, 100, 100, 20, _("Separation"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
|
||||
fdui->group_radio_separation = fl_bgn_group();
|
||||
fdui->radio_indent = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 120, 110, 30, idex(_("Indent|#I")));fl_set_button_shortcut(obj, scex(_("Indent|#I")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->radio_skip = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 150, 110, 30, idex(_("Skip|#K")));fl_set_button_shortcut(obj, scex(_("Skip|#K")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_end_group();
|
||||
|
||||
fdui->choice_class = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 20, 160, 30, idex(_("Class:|#C")));fl_set_button_shortcut(obj, scex(_("Class:|#C")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, ChoiceClassCB, 0);
|
||||
fdui->choice_pagestyle = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 60, 160, 30, idex(_("Pagestyle:|#P")));fl_set_button_shortcut(obj, scex(_("Pagestyle:|#P")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->choice_fonts = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 110, 160, 30, idex(_("Fonts:|#F")));fl_set_button_shortcut(obj, scex(_("Fonts:|#F")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->choice_fontsize = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 150, 160, 30, idex(_("Font Size:|#O")));fl_set_button_shortcut(obj, scex(_("Font Size:|#O")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 470, 390, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, DocumentCancelCB, 0);
|
||||
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 360, 390, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, DocumentApplyCB, 0);
|
||||
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 250, 390, 100, 30, _("OK"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, DocumentOKCB, 0);
|
||||
fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 450, 195, 120, 30, idex(_("Float Placement:|#L")));fl_set_button_shortcut(obj, scex(_("Float Placement:|#L")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->choice_postscript_driver = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 230, 190, 30, idex(_("PS Driver:|#S")));fl_set_button_shortcut(obj, scex(_("PS Driver:|#S")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->choice_inputenc = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 270, 190, 30, idex(_("Encoding:|#D")));fl_set_button_shortcut(obj, scex(_("Encoding:|#D")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 290, 20, 122, 70, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 432, 20, 136, 70, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
|
||||
fdui->group_radio_sides = fl_bgn_group();
|
||||
fdui->radio_sides_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 30, 120, 30, idex(_("One|#n")));fl_set_button_shortcut(obj, scex(_("One|#n")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->radio_sides_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 60, 120, 30, idex(_("Two|#T")));fl_set_button_shortcut(obj, scex(_("Two|#T")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_end_group();
|
||||
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 300, 10, 60, 20, _("Sides"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 440, 10, 80, 20, _("Columns"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
|
||||
fdui->group_radio_columns = fl_bgn_group();
|
||||
fdui->radio_columns_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 432, 30, 110, 30, idex(_("One|#e")));fl_set_button_shortcut(obj, scex(_("One|#e")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->radio_columns_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 432, 60, 110, 30, idex(_("Two|#w")));fl_set_button_shortcut(obj, scex(_("Two|#w")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_end_group();
|
||||
|
||||
fdui->input_extra = obj = fl_add_input(FL_NORMAL_INPUT, 450, 235, 120, 30, idex(_("Extra Options:|#X")));fl_set_button_shortcut(obj, scex(_("Extra Options:|#X")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->choice_language = obj = fl_add_box(FL_FRAME_BOX, 120, 190, 190, 30, _("Language:"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->input_default_skip = obj = fl_add_input(FL_NORMAL_INPUT, 220, 310, 90, 30, "");
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, DocumentDefskipCB, 0);
|
||||
fdui->choice_default_skip = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 310, 90, 30, idex(_("Default Skip:|#u")));fl_set_button_shortcut(obj, scex(_("Default Skip:|#u")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, DocumentDefskipCB, 0);
|
||||
fdui->slider_secnumdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 490, 275, 80, 30, _("Section number depth"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->slider_tocdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 490, 315, 80, 30, _("Table of contents depth"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->choice_spacing = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 350, 120, 30, idex(_("Spacing|#g")));fl_set_button_shortcut(obj, scex(_("Spacing|#g")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, DocumentSpacingCB, 0);
|
||||
fdui->button_bullets = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 110, 130, 30, idex(_("Bullet Shapes|#B")));fl_set_button_shortcut(obj, scex(_("Bullet Shapes|#B")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, DocumentBulletsCB, 0);
|
||||
fdui->check_use_amsmath = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 430, 145, 120, 30, idex(_("Use AMS Math|#M")));fl_set_button_shortcut(obj, scex(_("Use AMS Math|#M")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fdui->input_spacing = obj = fl_add_input(FL_FLOAT_INPUT, 250, 350, 95, 30, "");
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_NONE);
|
||||
fl_set_object_callback(obj, DocumentSpacingCB, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_document->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
||||
FD_form_character *create_form_form_character(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
@ -266,113 +84,7 @@ FD_form_character *create_form_form_character(void)
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_character->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
||||
FD_form_paragraph *create_form_form_paragraph(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_paragraph *fdui = (FD_form_paragraph *) fl_calloc(1, sizeof(FD_form_paragraph));
|
||||
|
||||
fdui->form_paragraph = fl_bgn_form(FL_NO_BOX, 490, 290);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 490, 290, "");
|
||||
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 127, 250, 100, 30, _("OK"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, ParagraphOKCB, 0);
|
||||
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 244, 250, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, ParagraphApplyCB, 0);
|
||||
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 360, 250, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, ParagraphCancelCB, 0);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 360, 110, 120, 50, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 110, 340, 90, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 360, 20, 120, 70, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 210, 20, 140, 70, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 190, 70, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fdui->input_labelwidth = obj = fl_add_input(FL_NORMAL_INPUT, 100, 210, 360, 30, idex(_("Label Width:|#d")));fl_set_button_shortcut(obj, scex(_("Label Width:|#d")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_West, FL_East);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 370, 100, 60, 20, _("Indent"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->check_lines_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 30, 120, 30, idex(_("Above|#b")));fl_set_button_shortcut(obj, scex(_("Above|#b")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->check_lines_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 60, 120, 30, idex(_("Below|#E")));fl_set_button_shortcut(obj, scex(_("Below|#E")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->check_pagebreaks_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 30, 120, 30, idex(_("Above|#o")));fl_set_button_shortcut(obj, scex(_("Above|#o")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->check_pagebreaks_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 60, 120, 30, idex(_("Below|#l")));fl_set_button_shortcut(obj, scex(_("Below|#l")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->check_noindent = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 120, 120, 30, idex(_("No Indent|#I")));fl_set_button_shortcut(obj, scex(_("No Indent|#I")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
|
||||
fdui->group_radio_alignment = fl_bgn_group();
|
||||
fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 30, 80, 30, idex(_("Right|#R")));fl_set_button_shortcut(obj, scex(_("Right|#R")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 80, 30, idex(_("Left|#f")));fl_set_button_shortcut(obj, scex(_("Left|#f")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->radio_align_block = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 100, 30, 80, 30, idex(_("Block|#c")));fl_set_button_shortcut(obj, scex(_("Block|#c")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 100, 60, 80, 30, idex(_("Center|#n")));fl_set_button_shortcut(obj, scex(_("Center|#n")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_end_group();
|
||||
|
||||
fdui->input_space_above = obj = fl_add_input(FL_NORMAL_INPUT, 180, 120, 90, 30, "");
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, ParagraphVSpaceCB, 0);
|
||||
fdui->input_space_below = obj = fl_add_input(FL_NORMAL_INPUT, 180, 160, 90, 30, "");
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, ParagraphVSpaceCB, 0);
|
||||
fdui->choice_space_above = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 120, 100, 30, idex(_("Above:|#v")));fl_set_button_shortcut(obj, scex(_("Above:|#v")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, ParagraphVSpaceCB, 0);
|
||||
fdui->choice_space_below = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 160, 100, 30, idex(_("Below:|#w")));fl_set_button_shortcut(obj, scex(_("Below:|#w")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, ParagraphVSpaceCB, 0);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 370, 10, 100, 20, _("Pagebreaks"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 230, 10, 50, 20, _("Lines"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 80, 20, _("Alignment"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 20, 100, 130, 20, _("Vertical Spaces"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->button_pextra = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 250, 100, 30, idex(_("ExtraOpt|#X")));fl_set_button_shortcut(obj, scex(_("ExtraOpt|#X")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, ParagraphExtraOpen, 0);
|
||||
fdui->check_space_above = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 270, 120, 40, 30, idex(_("Keep|#K")));fl_set_button_shortcut(obj, scex(_("Keep|#K")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->check_space_below = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 270, 160, 40, 30, idex(_("Keep|#p")));fl_set_button_shortcut(obj, scex(_("Keep|#p")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_paragraph->fdui = fdui;
|
||||
fdui->form_character->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -402,418 +114,9 @@ FD_form_preamble *create_form_form_preamble(void)
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_preamble->fdui = fdui;
|
||||
fdui->form_preamble->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
||||
FD_form_quotes *create_form_form_quotes(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_quotes *fdui = (FD_form_quotes *) fl_calloc(1, sizeof(FD_form_quotes));
|
||||
|
||||
fdui->form_quotes = fl_bgn_form(FL_NO_BOX, 340, 130);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 130, "");
|
||||
obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 100, 30, _("OK"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, QuotesOKCB, 0);
|
||||
obj = fl_add_button(FL_NORMAL_BUTTON, 120, 90, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, QuotesApplyCB, 0);
|
||||
obj = fl_add_button(FL_NORMAL_BUTTON, 230, 90, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, QuotesCancelCB, 0);
|
||||
fdui->choice_quotes_language = obj = fl_add_choice(FL_NORMAL_CHOICE, 90, 10, 160, 30, idex(_("Type:|#T")));fl_set_button_shortcut(obj, scex(_("Type:|#T")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
|
||||
fdui->group_radio_quotes_number = fl_bgn_group();
|
||||
fdui->radio_single = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 90, 50, 80, 30, idex(_("Single|#S")));fl_set_button_shortcut(obj, scex(_("Single|#S")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->radio_double = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 170, 50, 80, 30, idex(_("Double|#D")));fl_set_button_shortcut(obj, scex(_("Double|#D")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_end_group();
|
||||
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 290, 230, 10, 10, _("Text"));
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_quotes->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
|
||||
FD_form_paper *create_form_form_paper(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_paper *fdui = (FD_form_paper *) fl_calloc(1, sizeof(FD_form_paper));
|
||||
|
||||
fdui->form_paper = fl_bgn_form(FL_NO_BOX, 440, 430);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 430, "");
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 100, 200, 100, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
|
||||
fdui->choice_paperpackage = obj = fl_add_choice(FL_NORMAL_CHOICE, 290, 20, 140, 30, idex(_("Special:|#S")));fl_set_button_shortcut(obj, scex(_("Special:|#S")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 220, 200, 130, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 180, 190, 170, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 20, 170, 70, 20, _("Margins"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 240, 210, 160, 20, _("Foot/Head Margins"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 320, 390, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperCancelCB, 0);
|
||||
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 390, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperApplyCB, 0);
|
||||
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 100, 390, 100, 30, _("OK"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperOKCB, 0);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 440, 360, 10, 10, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 440, 350, 10, 10, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 100, 190, 70, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 20, 90, 95, 20, _("Orientation"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
|
||||
fdui->greoup_radio_orientation = fl_bgn_group();
|
||||
fdui->radio_portrait = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 105, 120, 30, idex(_("Portrait|#o")));fl_set_button_shortcut(obj, scex(_("Portrait|#o")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->radio_landscape = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 135, 120, 30, idex(_("Landscape|#L")));fl_set_button_shortcut(obj, scex(_("Landscape|#L")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_end_group();
|
||||
|
||||
fdui->choice_papersize2 = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 20, 160, 30, idex(_("Papersize:|#P")));fl_set_button_shortcut(obj, scex(_("Papersize:|#P")), 1);
|
||||
fl_set_object_boxtype(obj, FL_FRAME_BOX);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 240, 90, 150, 20, _("Custom Papersize"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->push_use_geometry = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 55, 170, 30, idex(_("Use Geometry Package|#U")));fl_set_button_shortcut(obj, scex(_("Use Geometry Package|#U")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->input_custom_width = obj = fl_add_input(FL_NORMAL_INPUT, 330, 115, 90, 30, idex(_("Width:|#W")));fl_set_button_shortcut(obj, scex(_("Width:|#W")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->input_custom_height = obj = fl_add_input(FL_NORMAL_INPUT, 330, 155, 90, 30, idex(_("Height:|#H")));fl_set_button_shortcut(obj, scex(_("Height:|#H")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->input_top_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 190, 90, 30, idex(_("Top:|#T")));fl_set_button_shortcut(obj, scex(_("Top:|#T")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->input_bottom_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 230, 90, 30, idex(_("Bottom:|#B")));fl_set_button_shortcut(obj, scex(_("Bottom:|#B")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->input_left_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 270, 90, 30, idex(_("Left:|#e")));fl_set_button_shortcut(obj, scex(_("Left:|#e")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->input_right_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 310, 90, 30, idex(_("Right:|#R")));fl_set_button_shortcut(obj, scex(_("Right:|#R")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->input_head_height = obj = fl_add_input(FL_NORMAL_INPUT, 330, 230, 90, 30, idex(_("Headheight:|#i")));fl_set_button_shortcut(obj, scex(_("Headheight:|#i")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->input_head_sep = obj = fl_add_input(FL_NORMAL_INPUT, 330, 270, 90, 30, idex(_("Headsep:|#d")));fl_set_button_shortcut(obj, scex(_("Headsep:|#d")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->input_foot_skip = obj = fl_add_input(FL_NORMAL_INPUT, 330, 310, 90, 30, idex(_("Footskip:|#F")));fl_set_button_shortcut(obj, scex(_("Footskip:|#F")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, PaperMarginsCB, 0);
|
||||
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 360, 420, 20, "");
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_paper->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
#if 0
|
||||
FD_form_table_options *create_form_form_table_options(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_table_options *fdui = (FD_form_table_options *) fl_calloc(1, sizeof(FD_form_table_options));
|
||||
|
||||
fdui->form_table_options = fl_bgn_form(FL_NO_BOX, 540, 310);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 540, 310, "");
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 300, 120, 110, 60, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 300, 20, 110, 90, "");
|
||||
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 20, 275, 330, 30, "");
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 430, 270, 100, 30, _("Close"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptCloseCB, 0);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 20, 20, 145, 105, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 30, 10, 70, 20, _("Borders"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->radio_border_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 75, 45, 25, 25, idex(_("Top|#T")));fl_set_button_shortcut(obj, scex(_("Top|#T")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 75, 75, 25, 25, idex(_("Bottom|#B")));fl_set_button_shortcut(obj, scex(_("Bottom|#B")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 55, 60, 25, 25, idex(_("Left|#L")));fl_set_button_shortcut(obj, scex(_("Left|#L")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 95, 60, 25, 25, idex(_("Right|#R")));fl_set_button_shortcut(obj, scex(_("Right|#R")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 175, 20, 105, 105, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 180, 10, 90, 20, _("Alignment"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 300, 10, 100, 20, _("Special Cell"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->radio_multicolumn = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 30, 95, 25, idex(_("Multicolumn|#M")));fl_set_button_shortcut(obj, scex(_("Multicolumn|#M")), 1);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->button_append_column = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 170, 120, 30, idex(_("Append Column|#A")));fl_set_button_shortcut(obj, scex(_("Append Column|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->button_delete_column = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 170, 120, 30, idex(_("Delete Column|#O")));fl_set_button_shortcut(obj, scex(_("Delete Column|#O")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->button_append_row = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 200, 120, 30, idex(_("Append Row|#p")));fl_set_button_shortcut(obj, scex(_("Append Row|#p")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->button_delete_row = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 200, 120, 30, idex(_("Delete Row|#w")));fl_set_button_shortcut(obj, scex(_("Delete Row|#w")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->button_table_delete = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 240, 250, 30, idex(_("Delete Table|#D")));fl_set_button_shortcut(obj, scex(_("Delete Table|#D")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->input_table_column = obj = fl_add_input(FL_NORMAL_INPUT, 290, 240, 60, 30, _("Column"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
|
||||
fdui->input_table_row = obj = fl_add_input(FL_NORMAL_INPUT, 360, 240, 60, 30, _("Row"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
|
||||
fdui->button_set_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 140, 120, 30, idex(_("Set Borders|#S")));fl_set_button_shortcut(obj, scex(_("Set Borders|#S")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->button_unset_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 140, 120, 30, idex(_("Unset Borders|#U")));fl_set_button_shortcut(obj, scex(_("Unset Borders|#U")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_longtable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 130, 90, 25, _("Longtable"));
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->input_column_width = obj = fl_add_input(FL_NORMAL_INPUT, 330, 190, 95, 30, _("Width"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, SetPWidthCB, 0);
|
||||
fdui->radio_rotate_table = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 155, 90, 25, idex(_("Rotate 90°|#9")));fl_set_button_shortcut(obj, scex(_("Rotate 90°|#9")), 1);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_linebreak_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 55, 95, 25, idex(_("Linebreaks|#N")));fl_set_button_shortcut(obj, scex(_("Linebreaks|#N")), 1);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 300, 110, 100, 20, _("Spec. Table"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 420, 20, 100, 160, "");
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 425, 10, 85, 20, _("Longtable"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->radio_lt_firsthead = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 30, 90, 25, _("First Head"));
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_lt_head = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 60, 90, 25, _("Head"));
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_lt_foot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 90, 90, 25, _("Foot"));
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_lt_lastfoot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 120, 90, 25, _("Last Foot"));
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_lt_newpage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 150, 90, 25, _("New Page"));
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_rotate_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 80, 95, 25, _("Rotate 90°"));
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->button_table_extra = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 235, 100, 30, idex(_("Extra|#X")));fl_set_button_shortcut(obj, scex(_("Extra|#X")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 175, 30, 80, 25, idex(_("Left|#e")));fl_set_button_shortcut(obj, scex(_("Left|#e")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 175, 55, 80, 25, idex(_("Right|#i")));fl_set_button_shortcut(obj, scex(_("Right|#i")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 175, 80, 80, 25, idex(_("Center|#C")));fl_set_button_shortcut(obj, scex(_("Center|#C")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_table_options->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
#endif
|
||||
|
||||
FD_form_paragraph_extra *create_form_form_paragraph_extra(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_paragraph_extra *fdui = (FD_form_paragraph_extra *) fl_calloc(1, sizeof(FD_form_paragraph_extra));
|
||||
|
||||
fdui->form_paragraph_extra = fl_bgn_form(FL_NO_BOX, 460, 250);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 460, 250, "");
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 170, 100, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 350, 20, 100, 100, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 190, 20, 150, 100, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 120, 20, _("Extra Options"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->input_pextra_width = obj = fl_add_input(FL_NORMAL_INPUT, 240, 30, 90, 30, idex(_("Length|#L")));fl_set_button_shortcut(obj, scex(_("Length|#L")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, CheckPExtraOptCB, 0);
|
||||
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 130, 210, 100, 30, _("OK"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, ParagraphExtraOKCB, 0);
|
||||
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 240, 210, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, ParagraphExtraApplyCB, 0);
|
||||
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 350, 210, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, ParagraphExtraCancelCB, 0);
|
||||
// xgettext:no-c-format
|
||||
fdui->input_pextra_widthp = obj = fl_add_input(FL_INT_INPUT, 240, 70, 90, 30, idex(_("or %|#o")));fl_set_button_shortcut(obj, scex(_("or %|#o")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, CheckPExtraOptCB, 0);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 200, 10, 60, 20, _("Width"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 350, 10, 90, 20, _("Alignment"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
|
||||
fdui->group_alignment = fl_bgn_group();
|
||||
fdui->radio_pextra_top = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 360, 30, 80, 30, idex(_("Top|#T")));fl_set_button_shortcut(obj, scex(_("Top|#T")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, CheckPExtraOptCB, 0);
|
||||
fdui->radio_pextra_middle = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 360, 60, 80, 30, idex(_("Middle|#d")));fl_set_button_shortcut(obj, scex(_("Middle|#d")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, CheckPExtraOptCB, 0);
|
||||
fdui->radio_pextra_bottom = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 360, 90, 80, 30, idex(_("Bottom|#B")));fl_set_button_shortcut(obj, scex(_("Bottom|#B")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, CheckPExtraOptCB, 0);
|
||||
fl_end_group();
|
||||
|
||||
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 170, 330, 30, "");
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fdui->radio_pextra_hfill = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 130, 300, 30, idex(_("HFill between Minipage paragraphs|#H")));fl_set_button_shortcut(obj, scex(_("HFill between Minipage paragraphs|#H")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fdui->radio_pextra_startmp = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 160, 260, 30, idex(_("Start new Minipage|#S")));fl_set_button_shortcut(obj, scex(_("Start new Minipage|#S")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
|
||||
fdui->group_extraopt = fl_bgn_group();
|
||||
fdui->radio_pextra_indent = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 30, 160, 30, idex(_("Indented Paragraph|#I")));fl_set_button_shortcut(obj, scex(_("Indented Paragraph|#I")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, CheckPExtraOptCB, 0);
|
||||
fdui->radio_pextra_minipage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 60, 160, 30, idex(_("Minipage|#M")));fl_set_button_shortcut(obj, scex(_("Minipage|#M")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, CheckPExtraOptCB, 0);
|
||||
fdui->radio_pextra_floatflt = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 90, 160, 30, idex(_("Floatflt|#F")));fl_set_button_shortcut(obj, scex(_("Floatflt|#F")), 1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, CheckPExtraOptCB, 0);
|
||||
fl_end_group();
|
||||
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_paragraph_extra->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
#if 0
|
||||
FD_form_table_extra *create_form_form_table_extra(void)
|
||||
{
|
||||
FL_OBJECT *obj;
|
||||
FD_form_table_extra *fdui = (FD_form_table_extra *) fl_calloc(1, sizeof(FD_form_table_extra));
|
||||
|
||||
fdui->form_table_extra = fl_bgn_form(FL_NO_BOX, 330, 200);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 330, 200, "");
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 15, 95, 305, 60, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 20, 85, 205, 20, _("Special Multicolumn Alignment"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
obj = fl_add_frame(FL_ENGRAVED_FRAME, 15, 20, 305, 60, "");
|
||||
fl_set_object_color(obj, FL_COL1, FL_COL1);
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->input_special_alignment = obj = fl_add_input(FL_NORMAL_INPUT, 25, 35, 280, 30, "");
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
obj = fl_add_button(FL_RETURN_BUTTON, 220, 160, 100, 30, _("Close"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
|
||||
fl_set_object_callback(obj, TableSpeCloseCB, 0);
|
||||
obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 170, 20, _("Special Column Alignment"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fdui->input_special_multialign = obj = fl_add_input(FL_NORMAL_INPUT, 25, 110, 280, 30, "");
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
|
||||
fl_set_object_resize(obj, FL_RESIZE_X);
|
||||
fl_set_object_callback(obj, TableOptionsCB, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_table_extra->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
/*---------------------------------------*/
|
||||
#endif
|
||||
|
@ -1,123 +1,21 @@
|
||||
/** Header file generated with fdesign **/
|
||||
|
||||
#ifndef FD_form_document_h_
|
||||
#define FD_form_document_h_
|
||||
|
||||
extern "C" {
|
||||
#ifndef FD_form_character_h_
|
||||
#define FD_form_character_h_
|
||||
|
||||
/** Callbacks, globals and object handlers **/
|
||||
extern "C" void ChoiceClassCB(FL_OBJECT *, long);
|
||||
extern "C" void DocumentCancelCB(FL_OBJECT *, long);
|
||||
extern "C" void DocumentApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void DocumentOKCB(FL_OBJECT *, long);
|
||||
extern "C" void DocumentDefskipCB(FL_OBJECT *, long);
|
||||
extern "C" void DocumentSpacingCB(FL_OBJECT *, long);
|
||||
extern "C" void DocumentBulletsCB(FL_OBJECT *, long);
|
||||
|
||||
extern "C" void CharacterApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void CharacterCloseCB(FL_OBJECT *, long);
|
||||
|
||||
extern "C" void ParagraphOKCB(FL_OBJECT *, long);
|
||||
extern "C" void ParagraphApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void ParagraphCancelCB(FL_OBJECT *, long);
|
||||
extern "C" void ParagraphVSpaceCB(FL_OBJECT *, long);
|
||||
extern "C" void ParagraphExtraOpen(FL_OBJECT *, long);
|
||||
|
||||
extern "C" void PreambleOKCB(FL_OBJECT *, long);
|
||||
extern "C" void PreambleApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void PreambleCancelCB(FL_OBJECT *, long);
|
||||
|
||||
extern "C" void QuotesOKCB(FL_OBJECT *, long);
|
||||
extern "C" void QuotesApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void QuotesCancelCB(FL_OBJECT *, long);
|
||||
/* Some extra funcs */
|
||||
|
||||
extern "C" void PaperMarginsCB(FL_OBJECT *, long);
|
||||
extern "C" void PaperCancelCB(FL_OBJECT *, long);
|
||||
extern "C" void PaperApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void PaperOKCB(FL_OBJECT *, long);
|
||||
|
||||
#if 0
|
||||
extern "C" void TableOptCloseCB(FL_OBJECT *, long);
|
||||
extern "C" void TableOptionsCB(FL_OBJECT *, long);
|
||||
extern "C" void SetPWidthCB(FL_OBJECT *, long);
|
||||
#endif
|
||||
|
||||
extern "C" void CheckPExtraOptCB(FL_OBJECT *, long);
|
||||
extern "C" void ParagraphExtraOKCB(FL_OBJECT *, long);
|
||||
extern "C" void ParagraphExtraApplyCB(FL_OBJECT *, long);
|
||||
extern "C" void ParagraphExtraCancelCB(FL_OBJECT *, long);
|
||||
|
||||
#if 0
|
||||
extern "C" void TableOptionsCB(FL_OBJECT *, long);
|
||||
extern "C" void TableSpeCloseCB(FL_OBJECT *, long);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/* Additional Functions/Methods */
|
||||
|
||||
#include "bufferparams.h"
|
||||
|
||||
extern bool UpdateLayoutDocument(BufferParams *params = NULL);
|
||||
extern bool UpdateLayoutPreamble();
|
||||
extern bool UpdateLayoutPaper();
|
||||
extern bool UpdateLayoutQuotes();
|
||||
extern bool UpdateLayoutParagraph();
|
||||
extern bool UpdateParagraphExtra();
|
||||
#if 0
|
||||
extern bool UpdateLayoutTable(int);
|
||||
#endif
|
||||
|
||||
extern void MenuLayoutCharacter();
|
||||
extern void MenuLayoutDocument();
|
||||
extern void MenuLayoutPreamble();
|
||||
extern void MenuLayoutPaper();
|
||||
extern void MenuLayoutQuotes();
|
||||
extern void MenuLayoutParagraph();
|
||||
#if 0
|
||||
extern void MenuLayoutTable(int);
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
|
||||
/**** Forms and Objects ****/
|
||||
typedef struct {
|
||||
FL_FORM *form_document;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *group_radio_separation;
|
||||
FL_OBJECT *radio_indent;
|
||||
FL_OBJECT *radio_skip;
|
||||
FL_OBJECT *choice_class;
|
||||
FL_OBJECT *choice_pagestyle;
|
||||
FL_OBJECT *choice_fonts;
|
||||
FL_OBJECT *choice_fontsize;
|
||||
FL_OBJECT *button_cancel;
|
||||
FL_OBJECT *button_apply;
|
||||
FL_OBJECT *button_ok;
|
||||
FL_OBJECT *input_float_placement;
|
||||
FL_OBJECT *choice_postscript_driver;
|
||||
FL_OBJECT *choice_inputenc;
|
||||
FL_OBJECT *group_radio_sides;
|
||||
FL_OBJECT *radio_sides_one;
|
||||
FL_OBJECT *radio_sides_two;
|
||||
FL_OBJECT *group_radio_columns;
|
||||
FL_OBJECT *radio_columns_one;
|
||||
FL_OBJECT *radio_columns_two;
|
||||
FL_OBJECT *input_extra;
|
||||
FL_OBJECT *choice_language;
|
||||
FL_OBJECT *input_default_skip;
|
||||
FL_OBJECT *choice_default_skip;
|
||||
FL_OBJECT *slider_secnumdepth;
|
||||
FL_OBJECT *slider_tocdepth;
|
||||
FL_OBJECT *choice_spacing;
|
||||
FL_OBJECT *button_bullets;
|
||||
FL_OBJECT *check_use_amsmath;
|
||||
FL_OBJECT *input_spacing;
|
||||
} FD_form_document;
|
||||
|
||||
extern FD_form_document * create_form_form_document(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_character;
|
||||
void *vdata;
|
||||
@ -136,35 +34,6 @@ typedef struct {
|
||||
} FD_form_character;
|
||||
|
||||
extern FD_form_character * create_form_form_character(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_paragraph;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *button_ok;
|
||||
FL_OBJECT *button_apply;
|
||||
FL_OBJECT *button_cancel;
|
||||
FL_OBJECT *input_labelwidth;
|
||||
FL_OBJECT *check_lines_top;
|
||||
FL_OBJECT *check_lines_bottom;
|
||||
FL_OBJECT *check_pagebreaks_top;
|
||||
FL_OBJECT *check_pagebreaks_bottom;
|
||||
FL_OBJECT *check_noindent;
|
||||
FL_OBJECT *group_radio_alignment;
|
||||
FL_OBJECT *radio_align_right;
|
||||
FL_OBJECT *radio_align_left;
|
||||
FL_OBJECT *radio_align_block;
|
||||
FL_OBJECT *radio_align_center;
|
||||
FL_OBJECT *input_space_above;
|
||||
FL_OBJECT *input_space_below;
|
||||
FL_OBJECT *choice_space_above;
|
||||
FL_OBJECT *choice_space_below;
|
||||
FL_OBJECT *button_pextra;
|
||||
FL_OBJECT *check_space_above;
|
||||
FL_OBJECT *check_space_below;
|
||||
} FD_form_paragraph;
|
||||
|
||||
extern FD_form_paragraph * create_form_form_paragraph(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_preamble;
|
||||
void *vdata;
|
||||
@ -177,118 +46,5 @@ typedef struct {
|
||||
} FD_form_preamble;
|
||||
|
||||
extern FD_form_preamble * create_form_form_preamble(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_quotes;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *choice_quotes_language;
|
||||
FL_OBJECT *group_radio_quotes_number;
|
||||
FL_OBJECT *radio_single;
|
||||
FL_OBJECT *radio_double;
|
||||
} FD_form_quotes;
|
||||
|
||||
extern FD_form_quotes * create_form_form_quotes(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_paper;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *choice_paperpackage;
|
||||
FL_OBJECT *button_cancel;
|
||||
FL_OBJECT *button_apply;
|
||||
FL_OBJECT *button_ok;
|
||||
FL_OBJECT *greoup_radio_orientation;
|
||||
FL_OBJECT *radio_portrait;
|
||||
FL_OBJECT *radio_landscape;
|
||||
FL_OBJECT *choice_papersize2;
|
||||
FL_OBJECT *push_use_geometry;
|
||||
FL_OBJECT *input_custom_width;
|
||||
FL_OBJECT *input_custom_height;
|
||||
FL_OBJECT *input_top_margin;
|
||||
FL_OBJECT *input_bottom_margin;
|
||||
FL_OBJECT *input_left_margin;
|
||||
FL_OBJECT *input_right_margin;
|
||||
FL_OBJECT *input_head_height;
|
||||
FL_OBJECT *input_head_sep;
|
||||
FL_OBJECT *input_foot_skip;
|
||||
FL_OBJECT *text_warning;
|
||||
} FD_form_paper;
|
||||
|
||||
extern FD_form_paper * create_form_form_paper(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_table_options;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *text_warning;
|
||||
FL_OBJECT *button_close;
|
||||
FL_OBJECT *radio_border_top;
|
||||
FL_OBJECT *radio_border_bottom;
|
||||
FL_OBJECT *radio_border_left;
|
||||
FL_OBJECT *radio_border_right;
|
||||
FL_OBJECT *radio_multicolumn;
|
||||
FL_OBJECT *button_append_column;
|
||||
FL_OBJECT *button_delete_column;
|
||||
FL_OBJECT *button_append_row;
|
||||
FL_OBJECT *button_delete_row;
|
||||
FL_OBJECT *button_table_delete;
|
||||
FL_OBJECT *input_table_column;
|
||||
FL_OBJECT *input_table_row;
|
||||
FL_OBJECT *button_set_borders;
|
||||
FL_OBJECT *button_unset_borders;
|
||||
FL_OBJECT *radio_longtable;
|
||||
FL_OBJECT *input_column_width;
|
||||
FL_OBJECT *radio_rotate_table;
|
||||
FL_OBJECT *radio_linebreak_cell;
|
||||
FL_OBJECT *radio_lt_firsthead;
|
||||
FL_OBJECT *radio_lt_head;
|
||||
FL_OBJECT *radio_lt_foot;
|
||||
FL_OBJECT *radio_lt_lastfoot;
|
||||
FL_OBJECT *radio_lt_newpage;
|
||||
FL_OBJECT *radio_rotate_cell;
|
||||
FL_OBJECT *button_table_extra;
|
||||
FL_OBJECT *radio_align_left;
|
||||
FL_OBJECT *radio_align_right;
|
||||
FL_OBJECT *radio_align_center;
|
||||
} FD_form_table_options;
|
||||
|
||||
extern FD_form_table_options * create_form_form_table_options(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_paragraph_extra;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *input_pextra_width;
|
||||
FL_OBJECT *button_ok;
|
||||
FL_OBJECT *button_apply;
|
||||
FL_OBJECT *button_cancel;
|
||||
FL_OBJECT *input_pextra_widthp;
|
||||
FL_OBJECT *group_alignment;
|
||||
FL_OBJECT *radio_pextra_top;
|
||||
FL_OBJECT *radio_pextra_middle;
|
||||
FL_OBJECT *radio_pextra_bottom;
|
||||
FL_OBJECT *text_warning;
|
||||
FL_OBJECT *radio_pextra_hfill;
|
||||
FL_OBJECT *radio_pextra_startmp;
|
||||
FL_OBJECT *group_extraopt;
|
||||
FL_OBJECT *radio_pextra_indent;
|
||||
FL_OBJECT *radio_pextra_minipage;
|
||||
FL_OBJECT *radio_pextra_floatflt;
|
||||
} FD_form_paragraph_extra;
|
||||
|
||||
extern FD_form_paragraph_extra * create_form_form_paragraph_extra(void);
|
||||
typedef struct {
|
||||
FL_FORM *form_table_extra;
|
||||
void *vdata;
|
||||
char *cdata;
|
||||
long ldata;
|
||||
FL_OBJECT *input_special_alignment;
|
||||
FL_OBJECT *input_special_multialign;
|
||||
} FD_form_table_extra;
|
||||
|
||||
extern FD_form_table_extra * create_form_form_table_extra(void);
|
||||
|
||||
}
|
||||
|
||||
#endif /* FD_form_document_h_ */
|
||||
#endif /* FD_form_character_h_ */
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -28,7 +28,7 @@ FD_LaTeXLog *create_form_LaTeXLog(void)
|
||||
fl_set_object_callback(obj, LatexLogUpdate, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->LaTeXLog->fdui = fdui;
|
||||
fdui->LaTeXLog->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -21,7 +21,7 @@ FD_form_title *create_form_form_title(void)
|
||||
fl_set_object_callback(obj, TimerCB, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_title->fdui = fdui;
|
||||
fdui->form_title->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -59,7 +59,7 @@ FD_form_figure *create_form_form_figure(void)
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_figure->fdui = fdui;
|
||||
fdui->form_figure->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -116,7 +116,7 @@ FD_form_external *create_form_form_external(void)
|
||||
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_external->fdui = fdui;
|
||||
fdui->form_external->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
1898
src/lyx_cb.C
1898
src/lyx_cb.C
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@
|
||||
#define LYX_CB_H
|
||||
|
||||
#include "LString.h"
|
||||
#include "lyxfont.h"
|
||||
|
||||
class BufferParams;
|
||||
|
||||
|
134
src/lyx_gui.C
134
src/lyx_gui.C
@ -44,16 +44,8 @@
|
||||
using std::endl;
|
||||
|
||||
FD_form_title * fd_form_title;
|
||||
FD_form_paragraph * fd_form_paragraph;
|
||||
FD_form_paragraph_extra * fd_form_paragraph_extra;
|
||||
FD_form_character * fd_form_character;
|
||||
FD_form_document * fd_form_document;
|
||||
FD_form_paper * fd_form_paper;
|
||||
FD_form_table_options * fd_form_table_options;
|
||||
FD_form_table_extra * fd_form_table_extra;
|
||||
FD_form_quotes * fd_form_quotes;
|
||||
FD_form_preamble * fd_form_preamble;
|
||||
FD_form_table * fd_form_table;
|
||||
FD_form_sendto * fd_form_sendto;
|
||||
FD_form_figure * fd_form_figure;
|
||||
FD_LaTeXLog * fd_latex_log; // from log_form.h
|
||||
@ -302,31 +294,6 @@ void LyXGUI::create_forms()
|
||||
fl_end_form();
|
||||
}
|
||||
|
||||
// the paragraph form
|
||||
fd_form_paragraph = create_form_form_paragraph();
|
||||
fl_set_form_atclose(fd_form_paragraph->form_paragraph,
|
||||
CancelCloseBoxCB, 0);
|
||||
fl_addto_choice(fd_form_paragraph->choice_space_above,
|
||||
_(" None | Defskip | Smallskip "
|
||||
"| Medskip | Bigskip | VFill | Length "));
|
||||
fl_addto_choice(fd_form_paragraph->choice_space_below,
|
||||
_(" None | Defskip | Smallskip "
|
||||
"| Medskip | Bigskip | VFill | Length "));
|
||||
fl_set_input_return(fd_form_paragraph->input_space_above,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paragraph->input_space_below,
|
||||
FL_RETURN_ALWAYS);
|
||||
|
||||
// the paragraph extra form
|
||||
fd_form_paragraph_extra = create_form_form_paragraph_extra();
|
||||
fl_set_form_atclose(fd_form_paragraph_extra->form_paragraph_extra,
|
||||
CancelCloseBoxCB, 0);
|
||||
fl_set_input_return(fd_form_paragraph_extra->input_pextra_width,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paragraph_extra->input_pextra_widthp,
|
||||
FL_RETURN_ALWAYS);
|
||||
lyxerr[Debug::INIT] << "Initializing form_paragraph...done" << endl;
|
||||
|
||||
// the character form
|
||||
fd_form_character = create_form_form_character();
|
||||
fl_set_form_atclose(fd_form_character->form_character,
|
||||
@ -362,112 +329,13 @@ void LyXGUI::create_forms()
|
||||
// build up the combox entries
|
||||
combo_language2->addto(_("No change"));
|
||||
combo_language2->addto(_("Reset"));
|
||||
for(Languages::const_iterator cit = languages.begin();
|
||||
for(Languages::iterator cit = languages.begin();
|
||||
cit != languages.end(); ++cit) {
|
||||
if ((*cit).second.lang() != "default")
|
||||
combo_language2->addto((*cit).second.lang().c_str());
|
||||
}
|
||||
combo_language2->select_text(_("No change"));
|
||||
|
||||
#ifdef USE_OLD_DOCUMENT_LAYOUT
|
||||
// the document form
|
||||
fd_form_document = create_form_form_document();
|
||||
fl_set_form_atclose(fd_form_document->form_document,
|
||||
CancelCloseBoxCB, 0);
|
||||
fl_addto_choice(fd_form_document->choice_spacing,
|
||||
_(" Single | OneHalf | Double | Other "));
|
||||
|
||||
fl_set_counter_bounds(fd_form_document->slider_secnumdepth,-2, 5);
|
||||
fl_set_counter_bounds(fd_form_document->slider_tocdepth,-1, 5);
|
||||
fl_set_counter_step(fd_form_document->slider_secnumdepth, 1, 1);
|
||||
fl_set_counter_step(fd_form_document->slider_tocdepth, 1, 1);
|
||||
fl_set_counter_precision(fd_form_document->slider_secnumdepth, 0);
|
||||
fl_set_counter_precision(fd_form_document->slider_tocdepth, 0);
|
||||
fl_addto_form(fd_form_document->form_document);
|
||||
combo_language = new Combox(FL_COMBOX_DROPLIST);
|
||||
ob = fd_form_document->choice_language;
|
||||
combo_language->add(ob->x, ob->y, ob->w, ob->h, 250);
|
||||
combo_language->shortcut("#G", 1);
|
||||
fl_end_form();
|
||||
|
||||
// "default" is not part of the languages array any more.
|
||||
combo_language->addto("default");
|
||||
for(Languages::const_iterator cit = languages.begin();
|
||||
cit != languages.end(); ++cit) {
|
||||
combo_language->addto((*cit).second.lang().c_str());
|
||||
}
|
||||
|
||||
// not really necessary, but we can do it anyway.
|
||||
fl_addto_choice(fd_form_document->choice_fontsize, "default|10|11|12");
|
||||
int n;
|
||||
for (n = 0; tex_fonts[n][0]; ++n) {
|
||||
fl_addto_choice(fd_form_document->choice_fonts, tex_fonts[n]);
|
||||
}
|
||||
|
||||
fl_addto_choice(fd_form_document->choice_inputenc,
|
||||
"default|auto|latin1|latin2|latin5"
|
||||
"|koi8-r|koi8-u|cp866|cp1251|iso88595");
|
||||
|
||||
for (n = 0; tex_graphics[n][0]; ++n) {
|
||||
fl_addto_choice(fd_form_document->choice_postscript_driver,
|
||||
tex_graphics[n]);
|
||||
}
|
||||
// not really necessary, but we can do it anyway.
|
||||
fl_addto_choice(fd_form_document->choice_pagestyle,
|
||||
"default|empty|plain|headings|fancy");
|
||||
fl_addto_choice(fd_form_document->choice_default_skip,
|
||||
_(" Smallskip | Medskip | Bigskip | Length "));
|
||||
fl_set_input_return(fd_form_document->input_default_skip,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_form_minsize(fd_form_document->form_document,
|
||||
fd_form_document->form_document->w,
|
||||
fd_form_document->form_document->h);
|
||||
lyxerr[Debug::INIT] << "Initializing form_document...done" << endl;
|
||||
|
||||
// the paper form
|
||||
fd_form_paper = create_form_form_paper();
|
||||
fl_set_form_atclose(fd_form_paper->form_paper,
|
||||
CancelCloseBoxCB, 0);
|
||||
fl_addto_choice(fd_form_paper->choice_papersize2,
|
||||
_(" Default | Custom | USletter | USlegal "
|
||||
"| USexecutive | A3 | A4 | A5 | B3 | B4 | B5 "));
|
||||
fl_addto_choice(fd_form_paper->choice_paperpackage,
|
||||
_(" None "
|
||||
"| A4 small Margins (only portrait) "
|
||||
"| A4 very small Margins (only portrait) "
|
||||
"| A4 very wide margins (only portrait) "));
|
||||
fl_set_input_return(fd_form_paper->input_custom_width,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paper->input_custom_height,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paper->input_top_margin,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paper->input_bottom_margin,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paper->input_left_margin,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paper->input_right_margin,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paper->input_head_height,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paper->input_head_sep,
|
||||
FL_RETURN_ALWAYS);
|
||||
fl_set_input_return(fd_form_paper->input_foot_skip,
|
||||
FL_RETURN_ALWAYS);
|
||||
lyxerr[Debug::INIT] << "Initializing form_paper...done" << endl;
|
||||
#endif
|
||||
|
||||
#ifdef USE_OLD_DOCUMENT_LAYOUT
|
||||
// the quotes form
|
||||
fd_form_quotes = create_form_form_quotes();
|
||||
fl_set_form_atclose(fd_form_quotes->form_quotes,
|
||||
CancelCloseBoxCB, 0);
|
||||
// Is it wrong of me to use « » instead of << >> ? (Lgb)
|
||||
// Maybe if people use a font other than latin1... (JMarc)
|
||||
fl_addto_choice(fd_form_quotes->choice_quotes_language,
|
||||
_(" ``text'' | ''text'' | ,,text`` | ,,text'' | «text» | »text« "));
|
||||
#endif
|
||||
|
||||
// the preamble form
|
||||
fd_form_preamble = create_form_form_preamble();
|
||||
fl_set_form_atclose(fd_form_preamble->form_preamble,
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "BufferView.h"
|
||||
#include "bibforms.h"
|
||||
#include "buffer.h"
|
||||
#include "bullet_forms.h"
|
||||
#include "form1.h"
|
||||
#include "gettext.h"
|
||||
#include "include_form.h"
|
||||
@ -42,21 +41,12 @@ using std::make_pair;
|
||||
|
||||
extern BufferView * current_view;
|
||||
|
||||
extern FD_form_paragraph * fd_form_paragraph;
|
||||
extern FD_form_paragraph_extra * fd_form_paragraph_extra;
|
||||
extern FD_form_character * fd_form_character;
|
||||
extern FD_form_document * fd_form_document;
|
||||
extern FD_form_paper * fd_form_paper;
|
||||
extern FD_form_table_options * fd_form_table_options;
|
||||
extern FD_form_quotes * fd_form_quotes;
|
||||
extern FD_form_preamble * fd_form_preamble;
|
||||
extern FD_form_table * fd_form_table;
|
||||
extern FD_form_sendto * fd_form_sendto;
|
||||
extern FD_form_figure * fd_form_figure;
|
||||
extern FD_form_paragraph_extra * fd_form_paragraph_extra;
|
||||
extern FD_LaTeXLog * fd_latex_log;
|
||||
extern FD_form_spell_check * fd_form_spell_check;
|
||||
extern FD_form_bullet * fd_form_bullet;
|
||||
extern FD_panel * fd_panel;
|
||||
extern FD_delim * fd_delim;
|
||||
extern FD_deco * fd_deco;
|
||||
@ -91,31 +81,9 @@ void CloseAllBufferRelatedDialogs()
|
||||
// have been created otherwise hiding one could cause a crash
|
||||
// need the visible check otherwise XForms prints a warning
|
||||
// if hiding an invisible form
|
||||
if (fd_form_paragraph->form_paragraph->visible) {
|
||||
fl_hide_form(fd_form_paragraph->form_paragraph);
|
||||
}
|
||||
if (fd_form_paragraph_extra->form_paragraph_extra->visible) {
|
||||
fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra);
|
||||
}
|
||||
if (fd_form_character->form_character->visible) {
|
||||
fl_hide_form(fd_form_character->form_character);
|
||||
}
|
||||
#ifdef USE_OLD_DOCUMENT_LAYOUT
|
||||
if (fd_form_document->form_document->visible) {
|
||||
fl_hide_form(fd_form_document->form_document);
|
||||
}
|
||||
if (fd_form_quotes->form_quotes->visible) {
|
||||
fl_hide_form(fd_form_quotes->form_quotes);
|
||||
}
|
||||
if (fd_form_paper->form_paper->visible) {
|
||||
fl_hide_form(fd_form_paper->form_paper);
|
||||
}
|
||||
if (fd_form_bullet) {
|
||||
if (fd_form_bullet->form_bullet->visible) {
|
||||
fl_hide_form(fd_form_bullet->form_bullet);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (fd_form_preamble->form_preamble->visible) {
|
||||
fl_hide_form(fd_form_preamble->form_preamble);
|
||||
}
|
||||
@ -175,31 +143,9 @@ void CloseAllBufferRelatedDialogs()
|
||||
// Again the Signal/Slot mechanism is tailor made for this task.
|
||||
void updateAllVisibleBufferRelatedDialogs()
|
||||
{
|
||||
#ifdef USE_OLD_DOCUMENT_LAYOUT
|
||||
if (fd_form_document->form_document->visible) {
|
||||
UpdateLayoutDocument();
|
||||
}
|
||||
if (fd_form_quotes->form_quotes->visible) {
|
||||
UpdateLayoutQuotes();
|
||||
}
|
||||
if (fd_form_paper->form_paper->visible) {
|
||||
UpdateLayoutPaper();
|
||||
}
|
||||
#endif
|
||||
if (fd_form_preamble->form_preamble->visible) {
|
||||
UpdateLayoutPreamble();
|
||||
}
|
||||
if (fd_form_paragraph->form_paragraph->visible) {
|
||||
UpdateLayoutParagraph();
|
||||
}
|
||||
if (fd_form_paragraph_extra->form_paragraph_extra->visible) {
|
||||
UpdateParagraphExtra();
|
||||
}
|
||||
if (fd_form_bullet) {
|
||||
if (fd_form_bullet->form_bullet->visible) {
|
||||
updateBulletForm();
|
||||
}
|
||||
}
|
||||
if (fd_latex_log->LaTeXLog->visible) {
|
||||
LatexLogUpdate(0,0);
|
||||
}
|
||||
@ -341,7 +287,7 @@ void WriteAlert(string const & s1, string const & s2, string const & s3)
|
||||
// Alarms user of something related to files
|
||||
void WriteFSAlert(string const & s1, string const & s2)
|
||||
{
|
||||
WriteAlert (s1, s2, strerror(errno));
|
||||
WriteAlert(s1, s2, strerror(errno));
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,10 +38,6 @@
|
||||
#include "MenuBackend.h"
|
||||
#include "ToolbarDefaults.h"
|
||||
#include "lyxlex.h"
|
||||
#if 1
|
||||
// only to get access to NEW_EXPORT
|
||||
#include "exporter.h"
|
||||
#endif
|
||||
|
||||
using std::endl;
|
||||
|
||||
@ -141,7 +137,8 @@ LyX::LyX(int * argc, char * argv[])
|
||||
|
||||
// Execute batch commands if available
|
||||
if (!batch_command.empty()) {
|
||||
lyxerr << "About to handle -x '" << batch_command << "'" << endl;
|
||||
lyxerr << "About to handle -x '"
|
||||
<< batch_command << "'" << endl;
|
||||
|
||||
// no buffer loaded, create one
|
||||
if (!last_loaded)
|
||||
@ -568,7 +565,7 @@ void LyX::queryUserLyXDir(bool explicit_userdir)
|
||||
|
||||
// Run configure in user lyx directory
|
||||
Path p(user_lyxdir);
|
||||
system(AddName(system_lyxdir, "configure").c_str());
|
||||
::system(AddName(system_lyxdir, "configure").c_str());
|
||||
lyxerr << "LyX: " << _("Done!") << endl;
|
||||
}
|
||||
|
||||
@ -744,25 +741,7 @@ bool LyX::easyParse(int * argc, char * argv[])
|
||||
if (i + 1 < *argc) {
|
||||
string type(argv[i+1]);
|
||||
removeargs = 2;
|
||||
#ifdef NEW_EXPORT
|
||||
batch_command = "buffer-export " + type;
|
||||
#else
|
||||
if (type == "tex")
|
||||
type = "latex";
|
||||
else if (type == "ps")
|
||||
type = "postscript";
|
||||
else if (type == "text" || type == "txt")
|
||||
type = "ascii";
|
||||
|
||||
if (type == "latex" || type == "postscript"
|
||||
|| type == "linuxdoc" || type == "docbook"
|
||||
|| type == "ascii" || type == "html")
|
||||
batch_command = "buffer-export " + type;
|
||||
else
|
||||
lyxerr << _("Unknown file type '")
|
||||
<< type << _("' after ")
|
||||
<< arg << _(" switch!") << endl;
|
||||
#endif
|
||||
} else
|
||||
lyxerr << _("Missing file type [eg latex, "
|
||||
"ps...] after ")
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -74,7 +74,7 @@ FD_xsendfax *create_form_xsendfax(void)
|
||||
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->xsendfax->fdui = fdui;
|
||||
fdui->xsendfax->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -92,7 +92,7 @@ FD_phonebook *create_form_phonebook(void)
|
||||
fl_set_object_callback(obj, cb_select_phoneno, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->phonebook->fdui = fdui;
|
||||
fdui->phonebook->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -111,7 +111,7 @@ FD_logfile *create_form_logfile(void)
|
||||
fl_set_object_callback(obj, FaxLogfileCloseCB, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->logfile->fdui = fdui;
|
||||
fdui->logfile->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ bool button_send(string const & fname, string const & sendcmd)
|
||||
lyxerr << "CMD: " << cmd << endl;
|
||||
Systemcalls one(Systemcalls::System, cmd);
|
||||
show_logfile(logfile, false);
|
||||
remove(logfile.c_str());
|
||||
lyx::unlink(logfile);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ void cb_delete_phoneno(FL_OBJECT *, long )
|
||||
|
||||
void cb_save_phoneno(FL_OBJECT *, long )
|
||||
{
|
||||
FILE * fp = fopen(phone_book.c_str(), "w");
|
||||
FILE * fp = ::fopen(phone_book.c_str(), "w");
|
||||
if (!fp) {
|
||||
WriteAlert(_("Error!"), _("Cannot open phone book: "), phone_book);
|
||||
return;
|
||||
|
@ -136,9 +136,9 @@ void LyXFindReplace::SearchReplaceCB()
|
||||
// clear the selection (if there is any)
|
||||
bv->toggleSelection(false);
|
||||
bv->text->
|
||||
ReplaceSelectionWithString(bv, replacestring.c_str());
|
||||
ReplaceSelectionWithString(bv, replacestring);
|
||||
bv->text->
|
||||
SetSelectionOverString(bv, replacestring.c_str());
|
||||
SetSelectionOverString(bv, replacestring);
|
||||
bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
}
|
||||
|
||||
@ -179,9 +179,9 @@ void LyXFindReplace::SearchReplaceAllCB()
|
||||
bv->update(BufferView::SELECT|BufferView::FITCUR);
|
||||
bv->toggleSelection(false);
|
||||
bv->text->
|
||||
ReplaceSelectionWithString(bv, replacestring.c_str());
|
||||
ReplaceSelectionWithString(bv, replacestring);
|
||||
bv->text->
|
||||
SetSelectionOverString(bv, replacestring.c_str());
|
||||
SetSelectionOverString(bv, replacestring);
|
||||
bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
++replace_count;
|
||||
}
|
||||
|
126
src/lyxfunc.C
126
src/lyxfunc.C
@ -107,16 +107,10 @@ extern bool MenuWriteAs(Buffer *);
|
||||
extern int MenuRunLaTeX(Buffer *);
|
||||
extern int MenuBuildProg(Buffer *);
|
||||
extern int MenuRunChktex(Buffer *);
|
||||
#ifndef NEW_EXPORT
|
||||
extern bool CreatePostscript(Buffer *, bool);
|
||||
#endif
|
||||
extern void MenuPrint(Buffer *);
|
||||
extern void MenuSendto();
|
||||
extern void QuitLyX();
|
||||
extern void MenuFax(Buffer *);
|
||||
#ifndef NEW_EXPORT
|
||||
extern void MenuExport(Buffer *, string const &);
|
||||
#endif
|
||||
extern void show_symbols_form(LyXFunc *);
|
||||
|
||||
extern LyXAction lyxaction;
|
||||
@ -124,22 +118,11 @@ extern LyXAction lyxaction;
|
||||
extern tex_accent_struct get_accent(kb_action action);
|
||||
|
||||
extern void AutoSave(BufferView *);
|
||||
#ifndef NEW_EXPORT
|
||||
extern bool PreviewDVI(Buffer *);
|
||||
extern bool PreviewPostscript(Buffer *);
|
||||
#endif
|
||||
extern void MenuInsertLabel(string const &);
|
||||
extern void MenuLayoutCharacter();
|
||||
extern void MenuLayoutParagraph();
|
||||
extern void MenuLayoutDocument();
|
||||
extern void MenuLayoutPaper();
|
||||
#if 0
|
||||
extern void MenuLayoutTable(int flag);
|
||||
#endif
|
||||
extern void MenuLayoutQuotes();
|
||||
extern void MenuLayoutPreamble();
|
||||
extern void MenuLayoutSave();
|
||||
extern void bulletForm();
|
||||
|
||||
extern Buffer * NewLyxFile(string const &);
|
||||
extern void LoadLyXFile(string const &);
|
||||
@ -486,18 +469,6 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
|
||||
static bool noLaTeX = lyxrc.latex_command == "none";
|
||||
bool disable = false;
|
||||
switch (action) {
|
||||
#ifndef NEW_EXPORT
|
||||
case LFUN_PREVIEW:
|
||||
disable = noLaTeX || lyxrc.view_dvi_command == "none";
|
||||
break;
|
||||
case LFUN_PREVIEWPS:
|
||||
disable = noLaTeX || lyxrc.view_ps_command == "none";
|
||||
break;
|
||||
case LFUN_RUNLATEX:
|
||||
case LFUN_RUNDVIPS:
|
||||
disable = noLaTeX;
|
||||
break;
|
||||
#endif
|
||||
case LFUN_MENUPRINT:
|
||||
disable = noLaTeX || lyxrc.print_command == "none";
|
||||
break;
|
||||
@ -510,27 +481,6 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
|
||||
else if (argument == "linuxdoc")
|
||||
disable = lyxrc.linuxdoc_to_lyx_command == "none";
|
||||
break;
|
||||
#ifndef NEW_EXPORT
|
||||
case LFUN_EXPORT:
|
||||
if (argument == "latex")
|
||||
disable = (! buf->isLatex() && ! buf->isLiterate()) ;
|
||||
else if (argument == "linuxdoc")
|
||||
disable = ! buf->isLinuxDoc();
|
||||
else if (argument == "docbook")
|
||||
disable = ! buf->isDocBook();
|
||||
else if (argument == "dvi" || argument == "postscript")
|
||||
disable = noLaTeX;
|
||||
else if (argument == "html")
|
||||
disable = (buf->isLinuxDoc()
|
||||
&& lyxrc.linuxdoc_to_html_command == "none")
|
||||
|| (buf->isDocBook()
|
||||
&& lyxrc.docbook_to_html_command == "none")
|
||||
|| (! buf->isLinuxDoc() && ! buf->isDocBook()
|
||||
&& lyxrc.html_command == "none");
|
||||
else if (argument == "custom")
|
||||
disable = (! buf->isLatex() && ! buf->isLiterate());
|
||||
break;
|
||||
#endif
|
||||
case LFUN_UNDO:
|
||||
disable = buf->undostack.empty();
|
||||
break;
|
||||
@ -651,7 +601,7 @@ string const LyXFunc::Dispatch(string const & s)
|
||||
string line = frontStrip(s);
|
||||
string arg = strip(frontStrip(split(line, cmd, ' ')));
|
||||
|
||||
return Dispatch(lyxaction.LookupFunc(cmd.c_str()), arg);
|
||||
return Dispatch(lyxaction.LookupFunc(cmd), arg);
|
||||
}
|
||||
|
||||
|
||||
@ -703,7 +653,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
// this is better
|
||||
pseudoaction =
|
||||
lyxaction.searchActionArg(action,
|
||||
argument.c_str());
|
||||
argument);
|
||||
|
||||
if (pseudoaction == -1) {
|
||||
pseudoaction = action;
|
||||
@ -840,8 +790,8 @@ string const LyXFunc::Dispatch(int ac,
|
||||
|
||||
if (!searched_string.empty() &&
|
||||
((action == LFUN_WORDFINDBACKWARD) ?
|
||||
ltCur->SearchBackward(owner->view(), searched_string.c_str()) :
|
||||
ltCur->SearchForward(owner->view(), searched_string.c_str()))) {
|
||||
ltCur->SearchBackward(owner->view(), searched_string) :
|
||||
ltCur->SearchForward(owner->view(), searched_string))) {
|
||||
|
||||
// ??? What is that ???
|
||||
owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
|
||||
@ -966,7 +916,6 @@ string const LyXFunc::Dispatch(int ac,
|
||||
reloadBuffer();
|
||||
break;
|
||||
|
||||
#ifdef NEW_EXPORT
|
||||
case LFUN_UPDATE:
|
||||
Exporter::Export(owner->buffer(), argument, true);
|
||||
break;
|
||||
@ -974,23 +923,6 @@ string const LyXFunc::Dispatch(int ac,
|
||||
case LFUN_PREVIEW:
|
||||
Exporter::Preview(owner->buffer(), argument);
|
||||
break;
|
||||
#else
|
||||
case LFUN_PREVIEW:
|
||||
PreviewDVI(owner->buffer());
|
||||
break;
|
||||
|
||||
case LFUN_PREVIEWPS:
|
||||
PreviewPostscript(owner->buffer());
|
||||
break;
|
||||
|
||||
case LFUN_RUNLATEX:
|
||||
MenuRunLaTeX(owner->buffer());
|
||||
break;
|
||||
|
||||
case LFUN_RUNDVIPS:
|
||||
CreatePostscript(owner->buffer(), false);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case LFUN_BUILDPROG:
|
||||
MenuBuildProg(owner->buffer());
|
||||
@ -1009,11 +941,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
break;
|
||||
|
||||
case LFUN_EXPORT:
|
||||
#ifdef NEW_EXPORT
|
||||
Exporter::Export(owner->buffer(), argument, false);
|
||||
#else
|
||||
MenuExport(owner->buffer(), argument);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LFUN_IMPORT:
|
||||
@ -1428,11 +1356,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
break;
|
||||
|
||||
case LFUN_LAYOUT_DOCUMENT:
|
||||
#ifdef USE_OLD_DOCUMENT_LAYOUT
|
||||
MenuLayoutDocument();
|
||||
#else
|
||||
owner->getDialogs()->showLayoutDocument();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LFUN_LAYOUT_PARAGRAPH:
|
||||
@ -1447,16 +1371,6 @@ string const LyXFunc::Dispatch(int ac,
|
||||
MenuLayoutCharacter();
|
||||
break;
|
||||
|
||||
#if 0
|
||||
case LFUN_LAYOUT_TABLE:
|
||||
{
|
||||
int flag = 0;
|
||||
if (argument == "true") flag = 1;
|
||||
MenuLayoutTable(flag);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case LFUN_LAYOUT_TABULAR:
|
||||
if (owner->view()->the_locking_inset) {
|
||||
if (owner->view()->the_locking_inset->LyxCode()==Inset::TABULAR_CODE) {
|
||||
@ -1472,18 +1386,6 @@ string const LyXFunc::Dispatch(int ac,
|
||||
}
|
||||
break;
|
||||
|
||||
case LFUN_LAYOUT_PAPER:
|
||||
#ifdef USE_OLD_DOCUMENT_LAYOUT
|
||||
MenuLayoutPaper();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LFUN_LAYOUT_QUOTES:
|
||||
#ifdef USE_OLD_DOCUMENT_LAYOUT
|
||||
MenuLayoutQuotes();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LFUN_LAYOUT_PREAMBLE:
|
||||
MenuLayoutPreamble();
|
||||
break;
|
||||
@ -1573,7 +1475,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
break;
|
||||
|
||||
case LFUN_INSERT_LABEL:
|
||||
MenuInsertLabel(argument.c_str());
|
||||
MenuInsertLabel(argument);
|
||||
break;
|
||||
|
||||
case LFUN_REF_INSERT:
|
||||
@ -2405,7 +2307,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
{
|
||||
int r = 2, c = 2;
|
||||
if (!argument.empty())
|
||||
sscanf(argument.c_str(),"%d%d", &r, &c);
|
||||
::sscanf(argument.c_str(),"%d%d", &r, &c);
|
||||
InsetTabular * new_inset =
|
||||
new InsetTabular(owner->buffer(), r, c);
|
||||
if (owner->view()->insertInset(new_inset))
|
||||
@ -2442,7 +2344,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
{
|
||||
int x;
|
||||
long y;
|
||||
sscanf(argument.c_str(), " %d %ld", &x, &y);
|
||||
::sscanf(argument.c_str(), " %d %ld", &x, &y);
|
||||
owner->view()->text->SetCursorFromCoordinates(owner->view(), x, y);
|
||||
}
|
||||
break;
|
||||
@ -2495,7 +2397,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
{
|
||||
char file_name[100];
|
||||
int row;
|
||||
sscanf(argument.c_str(), " %s %d", file_name, &row);
|
||||
::sscanf(argument.c_str(), " %s %d", file_name, &row);
|
||||
|
||||
// Must replace extension of the file to be .lyx and get full path
|
||||
string s = ChangeExtension(string(file_name), ".lyx");
|
||||
@ -2535,7 +2437,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
case LFUN_APROPOS:
|
||||
case LFUN_GETTIP:
|
||||
{
|
||||
int qa = lyxaction.LookupFunc(argument.c_str());
|
||||
int const qa = lyxaction.LookupFunc(argument);
|
||||
setMessage(lyxaction.helpText(static_cast<kb_action>(qa)));
|
||||
}
|
||||
break;
|
||||
@ -2656,7 +2558,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
|
||||
case LFUN_INSERT_MATH:
|
||||
{
|
||||
math_insert_symbol(argument.c_str());
|
||||
math_insert_symbol(argument);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2675,7 +2577,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
setErrorMessage(N_("Missing argument"));
|
||||
else {
|
||||
string s1 = token(s, ' ', 1);
|
||||
int na = s1.empty() ? 0: atoi(s1.c_str());
|
||||
int na = s1.empty() ? 0 : lyx::atoi(s1);
|
||||
owner->view()->
|
||||
open_new_inset(new InsetFormulaMacro(token(s, ' ', 0), na));
|
||||
}
|
||||
@ -2919,10 +2821,6 @@ string const LyXFunc::Dispatch(int ac,
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case LFUN_BUFFERBULLETSSELECT:
|
||||
bulletForm();
|
||||
break;
|
||||
|
||||
case LFUN_TOGGLECURSORFOLLOW:
|
||||
cursor_follows_scrollbar = !cursor_follows_scrollbar;
|
||||
break;
|
||||
@ -2981,7 +2879,7 @@ string const LyXFunc::Dispatch(int ac,
|
||||
else
|
||||
arg = lyxrc.date_insert_format;
|
||||
char datetmp[32];
|
||||
int datetmp_len = strftime(datetmp, 32, arg.c_str(), now_tm);
|
||||
int datetmp_len = ::strftime(datetmp, 32, arg.c_str(), now_tm);
|
||||
for (int i = 0; i < datetmp_len; i++) {
|
||||
owner->view()->text->InsertChar(owner->view(), datetmp[i]);
|
||||
owner->view()->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||
|
@ -177,7 +177,7 @@ string const LyXLex::getLongString(string const & endtoken)
|
||||
}
|
||||
|
||||
if (!prefix.empty()
|
||||
&& prefixIs(tmpstr, prefix.c_str())) {
|
||||
&& prefixIs(tmpstr, prefix)) {
|
||||
tmpstr.erase(0, prefix.length() - 1);
|
||||
}
|
||||
str += frontStrip(tmpstr, "\t") + '\n';
|
||||
|
@ -933,15 +933,14 @@ int LyXRC::read(string const & filename)
|
||||
break;
|
||||
}
|
||||
|
||||
if ((action = lyxaction.LookupFunc(cmd.c_str()))>= 0) {
|
||||
if ((action = lyxaction.LookupFunc(cmd))>= 0) {
|
||||
if (lyxerr.debugging(Debug::KBMAP)) {
|
||||
lyxerr << "RC_BIND: Sequence `"
|
||||
<< seq << "' Command `"
|
||||
<< cmd << "' Action `"
|
||||
<< action << '\'' << endl;
|
||||
}
|
||||
res = toplevel_keymap->bind(seq.c_str(),
|
||||
action);
|
||||
res = toplevel_keymap->bind(seq, action);
|
||||
if (res != 0) {
|
||||
lexrc.printError(
|
||||
"Invalid key sequence `"
|
||||
|
@ -55,6 +55,7 @@
|
||||
#include "debug.h"
|
||||
#include "LyXAction.h"
|
||||
#include "support/lstrings.h"
|
||||
#include "support/lyxlib.h"
|
||||
|
||||
#ifdef __EMX__
|
||||
#include <cstdlib>
|
||||
@ -115,7 +116,7 @@ void LyXComm::openConnection() {
|
||||
NP_NOWAIT|0x01, 0600, 0600, 0);
|
||||
if (rc == ERROR_PIPE_BUSY) {
|
||||
#else
|
||||
if (access(tmp.c_str(), F_OK) == 0) {
|
||||
if (::access(tmp.c_str(), F_OK) == 0) {
|
||||
#endif
|
||||
lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n"
|
||||
<< "If no other LyX program is active, please delete"
|
||||
@ -124,12 +125,12 @@ void LyXComm::openConnection() {
|
||||
return;
|
||||
}
|
||||
#ifndef __EMX__
|
||||
if (mkfifo(tmp.c_str(), 0600) < 0) {
|
||||
if (::mkfifo(tmp.c_str(), 0600) < 0) {
|
||||
lyxerr << "LyXComm: Could not create pipe " << tmp << '\n'
|
||||
<< strerror(errno) << endl;
|
||||
return;
|
||||
};
|
||||
infd = open(tmp.c_str(), O_RDONLY|O_NONBLOCK);
|
||||
infd = ::open(tmp.c_str(), O_RDONLY|O_NONBLOCK);
|
||||
#else
|
||||
if (rc != NO_ERROR) {
|
||||
errnum = TranslateOS2Error(rc);
|
||||
@ -161,7 +162,7 @@ void LyXComm::openConnection() {
|
||||
tmp = pipename + ".out";
|
||||
|
||||
#ifndef __EMX__
|
||||
if (access(tmp.c_str(), F_OK) == 0) {
|
||||
if (::access(tmp.c_str(), F_OK) == 0) {
|
||||
#else
|
||||
rc = DosCreateNPipe(tmp.c_str(), &fd, NP_ACCESS_DUPLEX,
|
||||
NP_NOWAIT|0x01, 0600, 0600, 0);
|
||||
@ -175,17 +176,17 @@ void LyXComm::openConnection() {
|
||||
return;
|
||||
}
|
||||
#ifndef __EMX__
|
||||
if (mkfifo(tmp.c_str(), 0600) < 0) {
|
||||
if (::mkfifo(tmp.c_str(), 0600) < 0) {
|
||||
lyxerr << "LyXComm: Could not create pipe " << tmp << '\n'
|
||||
<< strerror(errno) << endl;
|
||||
return;
|
||||
};
|
||||
if (access(tmp.c_str(), F_OK) != 0) {
|
||||
if (::access(tmp.c_str(), F_OK) != 0) {
|
||||
lyxerr << "LyXComm: Pipe " << tmp
|
||||
<< " does not exist" << endl;
|
||||
return;
|
||||
}
|
||||
outfd = open(tmp.c_str(), O_RDWR);
|
||||
outfd = ::open(tmp.c_str(), O_RDWR);
|
||||
#else
|
||||
if (rc != NO_ERROR) {
|
||||
errnum = TranslateOS2Error(rc);
|
||||
@ -257,7 +258,7 @@ void LyXComm::closeConnection() {
|
||||
<< '\n' << strerror(errno) << endl;
|
||||
}
|
||||
#ifndef __EMX__ // OS/2 named pipes will be automatically removed.
|
||||
if (unlink(tmp.c_str()) < 0){
|
||||
if (lyx::unlink(tmp) < 0){
|
||||
lyxerr << "LyXComm: Could not remove pipe " << tmp
|
||||
<< '\n' << strerror(errno) << endl;
|
||||
};
|
||||
@ -274,12 +275,12 @@ void LyXComm::closeConnection() {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (close(outfd) < 0) {
|
||||
if (::close(outfd) < 0) {
|
||||
lyxerr << "LyXComm: Could not close pipe " << tmp
|
||||
<< '\n' << strerror(errno) << endl;
|
||||
}
|
||||
#ifndef __EMX__
|
||||
if (unlink(tmp.c_str()) < 0){
|
||||
if (lyx::unlink(tmp) < 0){
|
||||
lyxerr << "LyXComm: Could not remove pipe " << tmp
|
||||
<< '\n' << strerror(errno) << endl;
|
||||
};
|
||||
@ -375,7 +376,7 @@ void LyXComm::send(string const & msg) {
|
||||
if (!ready) {
|
||||
lyxerr << "LyXComm: Pipes are closed. Could not send "
|
||||
<< msg << endl;
|
||||
} else if (write(outfd, msg.c_str(), msg.length()) < 0) {
|
||||
} else if (::write(outfd, msg.c_str(), msg.length()) < 0) {
|
||||
lyxerr << "LyXComm: Error sending message: " << msg
|
||||
<< '\n' << strerror(errno)
|
||||
<< "\nLyXComm: Resetting connection" << endl;
|
||||
@ -421,7 +422,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
|
||||
lyxerr[Debug::LYXSERVER] << "LyXServer: Received: '"
|
||||
<< msg << '\'' << endl;
|
||||
|
||||
char const *p = msg.c_str();
|
||||
char const * p = msg.c_str();
|
||||
|
||||
// --- parse the string --------------------------------------------
|
||||
//
|
||||
@ -523,7 +524,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
|
||||
// connect to the lyxfunc in the single LyXView we
|
||||
// support currently. (Lgb)
|
||||
|
||||
int action = lyxaction.LookupFunc(cmd.c_str());
|
||||
int action = lyxaction.LookupFunc(cmd);
|
||||
//int action = -1;
|
||||
string rval, buf;
|
||||
|
||||
|
@ -284,10 +284,6 @@ public:
|
||||
///
|
||||
void CursorRight(BufferView *, bool internal = true) const;
|
||||
///
|
||||
void CursorLeftIntern(BufferView *, bool internal = true) const;
|
||||
///
|
||||
void CursorRightIntern(BufferView *, bool internal = true) const;
|
||||
///
|
||||
void CursorLeftOneWord(BufferView *) const;
|
||||
///
|
||||
void CursorRightOneWord(BufferView *) const;
|
||||
|
@ -295,5 +295,5 @@ void LyXVC::showLog()
|
||||
string tmpf = tmpnam(0);
|
||||
vcs->getLog(tmpf);
|
||||
viewLog(tmpf);
|
||||
unlink(tmpf.c_str());
|
||||
lyx::unlink(tmpf);
|
||||
}
|
||||
|
@ -45,7 +45,8 @@ using std::endl;
|
||||
using std::vector;
|
||||
using std::max;
|
||||
|
||||
extern char * mathed_label;
|
||||
//extern char * mathed_label;
|
||||
extern string mathed_label;
|
||||
|
||||
extern char const * latex_special_chars;
|
||||
|
||||
@ -325,7 +326,7 @@ int InsetFormula::Latex(Buffer const *, ostream & os, bool fragile, bool) const
|
||||
int ret = 0;
|
||||
//#warning Alejandro, the number of lines is not returned in this case
|
||||
// This problem will disapear at 0.13.
|
||||
mathed_write(par, os, &ret, fragile, label.c_str());
|
||||
mathed_write(par, os, &ret, fragile, label);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -365,7 +366,9 @@ void InsetFormula::Read(Buffer const *, LyXLex & lex)
|
||||
mathed_parser_file(is, lex.GetLineNo());
|
||||
|
||||
// Silly hack to read labels.
|
||||
mathed_label = 0;
|
||||
//mathed_label = 0;
|
||||
mathed_label.erase();
|
||||
|
||||
mathed_parse(0, 0, &par);
|
||||
par->Metrics();
|
||||
disp_flag = (par->GetType() > 0);
|
||||
@ -373,9 +376,11 @@ void InsetFormula::Read(Buffer const *, LyXLex & lex)
|
||||
// Update line number
|
||||
lex.setLineNo(mathed_parser_lineno());
|
||||
|
||||
if (mathed_label) {
|
||||
//if (mathed_label) {
|
||||
if (!mathed_label.empty()) {
|
||||
label = mathed_label;
|
||||
mathed_label = 0;
|
||||
//mathed_label = 0;
|
||||
mathed_label.erase();
|
||||
}
|
||||
|
||||
// reading of end_inset in the inset!!!
|
||||
@ -941,7 +946,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
|
||||
|
||||
case LFUN_MATH_SIZE:
|
||||
if (!arg.empty()) {
|
||||
latexkeys * l = in_word_set (arg.c_str(), strlen(arg.c_str()));
|
||||
latexkeys * l = in_word_set (arg);
|
||||
int sz = (l) ? l->id: -1;
|
||||
mathcursor->SetSize(sz);
|
||||
UpdateLocal(bv);
|
||||
@ -951,7 +956,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
|
||||
case LFUN_INSERT_MATH:
|
||||
{
|
||||
bv->lockedInsetStoreUndo(Undo::INSERT);
|
||||
InsertSymbol(bv, arg.c_str());
|
||||
InsertSymbol(bv, arg);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -997,7 +1002,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
|
||||
|
||||
if (n > 0) {
|
||||
if (isdigit(lf[0]))
|
||||
ilf = atoi(lf);
|
||||
ilf = lyx::atoi(lf);
|
||||
else
|
||||
if (lf[1]) {
|
||||
l = in_word_set(lf, strlen(lf));
|
||||
@ -1009,7 +1014,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
|
||||
|
||||
if (n > 1) {
|
||||
if (isdigit(rg[0]))
|
||||
irg = atoi(rg);
|
||||
irg = lyx::atoi(rg);
|
||||
else
|
||||
if (rg[1]) {
|
||||
l = in_word_set(rg, strlen(rg));
|
||||
@ -1051,7 +1056,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
|
||||
if (!lb.empty() && lb[0] > ' ') {
|
||||
SetNumber(true);
|
||||
if (par->GetType() == LM_OT_MPARN) {
|
||||
mathcursor->setLabel(lb.c_str());
|
||||
mathcursor->setLabel(lb);
|
||||
// MathMatrixInset *mt = (MathMatrixInset*)par;
|
||||
// mt->SetLabel(lb);
|
||||
} else {
|
||||
|
@ -45,7 +45,7 @@ InsetFormulaMacro::InsetFormulaMacro()
|
||||
InsetFormulaMacro::InsetFormulaMacro(string nm, int na, bool /*e*/)
|
||||
: InsetFormula(true), name(nm)
|
||||
{
|
||||
tmacro = MathMacroTable::mathMTable.getTemplate(name.c_str());
|
||||
tmacro = MathMacroTable::mathMTable.getTemplate(name);
|
||||
if (!tmacro) {
|
||||
tmacro = new MathMacroTemplate(name.c_str(), na);
|
||||
MathMacroTable::mathMTable.addTemplate(tmacro);
|
||||
@ -206,7 +206,7 @@ InsetFormulaMacro::LocalDispatch(BufferView * bv,
|
||||
int action, string const & arg)
|
||||
{
|
||||
if (action == LFUN_MATH_MACROARG) {
|
||||
int i = atoi(arg.c_str()) - 1;
|
||||
int i = lyx::atoi(arg) - 1;
|
||||
if (i >= 0 && i < tmacro->getNoArgs()) {
|
||||
mathcursor->Insert(tmacro->getMacroPar(i), LM_TC_INSET);
|
||||
InsetFormula::UpdateLocal(bv);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -55,7 +55,7 @@ FD_panel *create_form_panel(void)
|
||||
fl_set_object_callback(obj, button_cb, MM_SQRT);
|
||||
fdui->frac = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 40, 15, 30, 30, "");
|
||||
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
|
||||
fl_set_object_lcol(obj, FL_COL1);
|
||||
fl_set_object_lcolor(obj, FL_COL1);
|
||||
fl_set_object_callback(obj, button_cb, MM_FRAC);
|
||||
fdui->delim = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 50, 30, 30, "");
|
||||
fl_set_object_color(obj, FL_MCOL, FL_BLUE);
|
||||
@ -71,7 +71,7 @@ FD_panel *create_form_panel(void)
|
||||
fl_set_object_callback(obj, button_cb, MM_SPACE);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->panel->fdui = fdui;
|
||||
fdui->panel->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -85,7 +85,7 @@ FD_delim *create_form_delim(void)
|
||||
fdui->delim = fl_bgn_form(FL_NO_BOX, 250, 260);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 250, 260, "");
|
||||
fdui->menu = obj = fl_add_bmtable(FL_PUSH_BUTTON, 40, 70, 170, 140, "");
|
||||
fl_set_object_lcol(obj, FL_BLUE);
|
||||
fl_set_object_lcolor(obj, FL_BLUE);
|
||||
fl_set_object_callback(obj, delim_cb, 2);
|
||||
|
||||
fdui->lado = fl_bgn_group();
|
||||
@ -111,7 +111,7 @@ FD_delim *create_form_delim(void)
|
||||
fl_set_object_callback(obj, delim_cb, MM_OK);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->delim->fdui = fdui;
|
||||
fdui->delim->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -158,7 +158,7 @@ FD_matrix *create_form_matrix(void)
|
||||
fl_set_object_callback(obj, matrix_cb, MM_APPLY);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->matrix->fdui = fdui;
|
||||
fdui->matrix->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -172,14 +172,14 @@ FD_deco *create_form_deco(void)
|
||||
fdui->deco = fl_bgn_form(FL_NO_BOX, 160, 150);
|
||||
obj = fl_add_box(FL_UP_BOX, 0, 0, 160, 150, "");
|
||||
fdui->menu = obj = fl_add_bmtable(FL_PUSH_BUTTON, 10, 10, 140, 90, "");
|
||||
fl_set_object_lcol(obj, FL_BLUE);
|
||||
fl_set_object_lcolor(obj, FL_BLUE);
|
||||
fl_set_object_callback(obj, deco_cb, MM_APPLY);
|
||||
obj = fl_add_button(FL_RETURN_BUTTON, 30, 110, 100, 30, _("Close"));
|
||||
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
|
||||
fl_set_object_callback(obj, deco_cb, MM_CLOSE);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->deco->fdui = fdui;
|
||||
fdui->deco->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -231,7 +231,7 @@ FD_space *create_form_space(void)
|
||||
|
||||
fl_end_form();
|
||||
|
||||
//fdui->space->fdui = fdui;
|
||||
fdui->space->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ MathedInset * MathMatrixInset::Clone()
|
||||
void MathMatrixInset::SetAlign(char vv, string const & hh)
|
||||
{
|
||||
v_align = vv;
|
||||
strncpy(h_align, hh.c_str(), nc);
|
||||
::strncpy(h_align, hh.c_str(), nc);
|
||||
}
|
||||
|
||||
|
||||
|
@ -254,7 +254,7 @@ void MathMacroArgument::Write(ostream & os, bool fragile)
|
||||
|
||||
/* --------------------- MathMacroTemplate ---------------------------*/
|
||||
|
||||
MathMacroTemplate::MathMacroTemplate(char const * nm, int na, int flg):
|
||||
MathMacroTemplate::MathMacroTemplate(string const & nm, int na, int flg):
|
||||
MathParInset(LM_ST_TEXT, nm, LM_OT_MACRO),
|
||||
flags(flg), nargs(na)
|
||||
{
|
||||
|
@ -142,7 +142,7 @@ class MathMacroTemplate: public MathParInset {
|
||||
public:
|
||||
/// A template constructor needs all the data
|
||||
explicit
|
||||
MathMacroTemplate(char const *, int na = 0, int f = 0);
|
||||
MathMacroTemplate(string const &, int na = 0, int f = 0);
|
||||
///
|
||||
~MathMacroTemplate();
|
||||
///
|
||||
|
@ -195,10 +195,10 @@ void matrix_cb(FL_OBJECT *, long data)
|
||||
case MM_APPLY:
|
||||
case MM_OK:
|
||||
{
|
||||
char c = v_align_c[fl_get_choice(fd_matrix->valign)-1];
|
||||
char c = v_align_c[fl_get_choice(fd_matrix->valign) - 1];
|
||||
char const * sh = fl_get_input(fd_matrix->halign);
|
||||
int nx = int(fl_get_slider_value(fd_matrix->columns)+0.5);
|
||||
int ny = int(fl_get_slider_value(fd_matrix->rows)+0.5);
|
||||
int nx = int(fl_get_slider_value(fd_matrix->columns) + 0.5);
|
||||
int ny = int(fl_get_slider_value(fd_matrix->rows) + 0.5);
|
||||
if (data == MM_OK) fl_hide_form(fd_matrix->matrix);
|
||||
std::ostringstream ost;
|
||||
ost << nx << ' ' << ny << ' ' << c << sh;
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <cctype>
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -29,6 +29,7 @@
|
||||
#include "math_macro.h"
|
||||
#include "math_root.h"
|
||||
#include "debug.h"
|
||||
#include "support/lyxlib.h"
|
||||
|
||||
using std::istream;
|
||||
using std::endl;
|
||||
@ -45,12 +46,15 @@ enum {
|
||||
FLAG_BRACK_END = 256 // Next ] ends the parsing process
|
||||
};
|
||||
|
||||
static
|
||||
YYSTYPE yylval;
|
||||
|
||||
|
||||
static short mathed_env = LM_EN_INTEXT;
|
||||
static
|
||||
short mathed_env = LM_EN_INTEXT;
|
||||
|
||||
string mathed_label;
|
||||
|
||||
char * mathed_label = 0;
|
||||
|
||||
char const * latex_mathenv[] = {
|
||||
"math",
|
||||
@ -62,10 +66,12 @@ char const * latex_mathenv[] = {
|
||||
};
|
||||
|
||||
|
||||
|
||||
char const * latex_mathspace[] = {
|
||||
"!", ",", ":", ";", "quad", "qquad"
|
||||
};
|
||||
|
||||
|
||||
char const * latex_special_chars = "#$%&_{}";
|
||||
|
||||
// These are lexical codes, not semantic
|
||||
@ -92,15 +98,6 @@ static int yylineno;
|
||||
static istream * yyis;
|
||||
static bool yy_mtextmode= false;
|
||||
|
||||
static inline
|
||||
char * strnew(char const * s)
|
||||
{
|
||||
char * s1 = new char[strlen(s) + 1]; // this leaks when not delete[]'ed
|
||||
strcpy(s1, s);
|
||||
return s1;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
void mathPrintError(string const & msg)
|
||||
{
|
||||
@ -142,9 +139,6 @@ void LexInitCodes()
|
||||
static
|
||||
char LexGetArg(char lf, bool accept_spaces= false)
|
||||
{
|
||||
char rg;
|
||||
char * p = &yytext[0];
|
||||
int bcnt = 1;
|
||||
unsigned char c;
|
||||
char cc;
|
||||
while (yyis->good()) {
|
||||
@ -158,18 +152,21 @@ char LexGetArg(char lf, bool accept_spaces= false)
|
||||
break;
|
||||
}
|
||||
}
|
||||
rg = (lf == '{') ? '}': ((lf == '[') ? ']': ((lf == '(') ? ')': 0));
|
||||
char const rg =
|
||||
(lf == '{') ? '}' : ((lf == '[') ? ']' : ((lf == '(') ? ')' : 0));
|
||||
if (!rg) {
|
||||
lyxerr << "Math parse error: unknown bracket '"
|
||||
<< lf << "'" << endl;
|
||||
return '\0';
|
||||
}
|
||||
char * p = &yytext[0];
|
||||
int bcnt = 1;
|
||||
do {
|
||||
yyis->get(cc);
|
||||
c = cc;
|
||||
if (c == lf) ++bcnt;
|
||||
if (c == rg) --bcnt;
|
||||
if ((c > ' ' || (c == ' ' && accept_spaces)) && bcnt>0) *(p++) = c;
|
||||
if ((c > ' ' || (c == ' ' && accept_spaces)) && bcnt > 0) *(p++) = c;
|
||||
} while (bcnt > 0 && yyis->good());
|
||||
*p = '\0';
|
||||
return rg;
|
||||
@ -180,11 +177,11 @@ static
|
||||
int yylex(void)
|
||||
{
|
||||
static int init_done = 0;
|
||||
unsigned char c;
|
||||
char cc;
|
||||
|
||||
if (!init_done) LexInitCodes();
|
||||
|
||||
unsigned char c;
|
||||
char cc;
|
||||
while (yyis->good()) {
|
||||
yyis->get(cc);
|
||||
c = cc;
|
||||
@ -192,37 +189,71 @@ int yylex(void)
|
||||
if (yy_mtextmode && c == ' ') {
|
||||
yylval.i= ' ';
|
||||
return LM_TK_ALPHA;
|
||||
}
|
||||
} else
|
||||
|
||||
if (lexcode[c] == LexNewLine) {
|
||||
++yylineno;
|
||||
continue;
|
||||
}
|
||||
} else
|
||||
|
||||
if (lexcode[c] == LexComment)
|
||||
do { yyis->get(cc); c = cc; } while (c != '\n' % yyis->good()); // eat comments
|
||||
if (lexcode[c] == LexComment) {
|
||||
do {
|
||||
yyis->get(cc);
|
||||
c = cc;
|
||||
} while (c != '\n' % yyis->good()); // eat comments
|
||||
} else
|
||||
|
||||
if (lexcode[c] == LexDigit || lexcode[c] == LexOther || lexcode[c] == LexMathSpace) { yylval.i = c; return LM_TK_STR; }
|
||||
if (lexcode[c] == LexAlpha) { yylval.i= c; return LM_TK_ALPHA; }
|
||||
if (lexcode[c] == LexBOP) { yylval.i= c; return LM_TK_BOP; }
|
||||
if (lexcode[c] == LexSelf) { return c; }
|
||||
if (lexcode[c] == LexDigit
|
||||
|| lexcode[c] == LexOther
|
||||
|| lexcode[c] == LexMathSpace) {
|
||||
yylval.i = c;
|
||||
return LM_TK_STR;
|
||||
} else
|
||||
if (lexcode[c] == LexAlpha) {
|
||||
yylval.i= c;
|
||||
return LM_TK_ALPHA;
|
||||
} else
|
||||
if (lexcode[c] == LexBOP) {
|
||||
yylval.i= c;
|
||||
return LM_TK_BOP;
|
||||
} else
|
||||
if (lexcode[c] == LexSelf) {
|
||||
return c;
|
||||
} else
|
||||
if (lexcode[c] == LexArgument) {
|
||||
yyis->get(cc);
|
||||
c = cc;
|
||||
yylval.i = c - '0';
|
||||
return LM_TK_ARGUMENT;
|
||||
}
|
||||
if (lexcode[c] == LexOpen) { return LM_TK_OPEN; }
|
||||
if (lexcode[c] == LexClose) { return LM_TK_CLOSE; }
|
||||
|
||||
} else
|
||||
if (lexcode[c] == LexOpen) {
|
||||
return LM_TK_OPEN;
|
||||
} else
|
||||
if (lexcode[c] == LexClose) {
|
||||
return LM_TK_CLOSE;
|
||||
} else
|
||||
if (lexcode[c] == LexESC) {
|
||||
yyis->get(cc);
|
||||
c = cc;
|
||||
if (c == '\\') { return LM_TK_NEWLINE; }
|
||||
if (c == '(') { yylval.i = LM_EN_INTEXT; return LM_TK_BEGIN; }
|
||||
if (c == ')') { yylval.i = LM_EN_INTEXT; return LM_TK_END; }
|
||||
if (c == '[') { yylval.i = LM_EN_DISPLAY; return LM_TK_BEGIN; }
|
||||
if (c == ']') { yylval.i = LM_EN_DISPLAY; return LM_TK_END; }
|
||||
if (c == '\\') {
|
||||
return LM_TK_NEWLINE;
|
||||
}
|
||||
if (c == '(') {
|
||||
yylval.i = LM_EN_INTEXT;
|
||||
return LM_TK_BEGIN;
|
||||
}
|
||||
if (c == ')') {
|
||||
yylval.i = LM_EN_INTEXT;
|
||||
return LM_TK_END;
|
||||
}
|
||||
if (c == '[') {
|
||||
yylval.i = LM_EN_DISPLAY;
|
||||
return LM_TK_BEGIN;
|
||||
}
|
||||
if (c == ']') {
|
||||
yylval.i = LM_EN_DISPLAY;
|
||||
return LM_TK_END;
|
||||
}
|
||||
if (strchr(latex_special_chars, c)) {
|
||||
yylval.i = c;
|
||||
return LM_TK_SPECIAL;
|
||||
@ -230,7 +261,7 @@ int yylex(void)
|
||||
if (lexcode[c] == LexMathSpace) {
|
||||
int i;
|
||||
for (i = 0; i < 4 && static_cast<int>(c) != latex_mathspace[i][0]; ++i);
|
||||
yylval.i = (i < 4) ? i: 0;
|
||||
yylval.i = (i < 4) ? i : 0;
|
||||
return LM_TK_SPACE;
|
||||
}
|
||||
if (lexcode[c] == LexAlpha || lexcode[c] == LexDigit) {
|
||||
@ -270,6 +301,7 @@ int yylex(void)
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
int parse_align(char * hor, char *)
|
||||
{
|
||||
int nc = 0;
|
||||
@ -279,9 +311,12 @@ int parse_align(char * hor, char *)
|
||||
|
||||
|
||||
// Accent hacks only for 0.12. Stolen from Cursor.
|
||||
static
|
||||
int accent = 0;
|
||||
static
|
||||
int nestaccent[8];
|
||||
|
||||
static
|
||||
void setAccent(int ac)
|
||||
{
|
||||
if (ac > 0 && accent < 8) {
|
||||
@ -291,6 +326,7 @@ void setAccent(int ac)
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
MathedInset * doAccent(byte c, MathedTextCodes t)
|
||||
{
|
||||
MathedInset * ac = 0;
|
||||
@ -307,6 +343,7 @@ MathedInset * doAccent(byte c, MathedTextCodes t)
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
MathedInset * doAccent(MathedInset * p)
|
||||
{
|
||||
MathedInset * ac = 0;
|
||||
@ -326,13 +363,14 @@ MathedInset * doAccent(MathedInset * p)
|
||||
LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
MathParInset ** mtx)
|
||||
{
|
||||
int t = yylex(), tprev = 0;
|
||||
int t = yylex();
|
||||
int tprev = 0;
|
||||
bool panic = false;
|
||||
static int plevel = -1;
|
||||
static int size = LM_ST_TEXT;
|
||||
MathedTextCodes varcode = LM_TC_VAR;
|
||||
MathedInset * binset = 0;
|
||||
static MathMacroTemplate * macro= 0;
|
||||
static MathMacroTemplate * macro = 0;
|
||||
|
||||
int brace = 0;
|
||||
int acc_brace = 0;
|
||||
@ -375,15 +413,15 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
int na = 0;
|
||||
|
||||
LexGetArg('{');
|
||||
// This name lives until quitting, for that reason
|
||||
// I didn't care on deleting explicitly. Later I will.
|
||||
char const * name = strnew(&yytext[1]);
|
||||
string const name(&yytext[1]);
|
||||
|
||||
// ugly trick to be removed soon (lyx3)
|
||||
char c; yyis->get(c);
|
||||
yyis->putback(c);
|
||||
//char c; yyis->get(c);
|
||||
//yyis->putback(c);
|
||||
char const c = yyis->peek();
|
||||
if (c == '[') {
|
||||
LexGetArg('[');
|
||||
na = atoi(yytext);
|
||||
na = lyx::atoi(yytext);
|
||||
}
|
||||
macro = new MathMacroTemplate(name, na);
|
||||
flags = FLAG_BRACE|FLAG_BRACE_LAST;
|
||||
@ -399,7 +437,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
case LM_TK_STR:
|
||||
{
|
||||
if (accent) {
|
||||
data.Insert(doAccent(yylval.i, LM_TC_CONST));
|
||||
data.Insert(doAccent(yylval.i, LM_TC_CONST));
|
||||
} else
|
||||
data.Insert (yylval.i, LM_TC_CONST);
|
||||
break;
|
||||
@ -454,8 +492,8 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
{
|
||||
if (flags & FLAG_BRACK_ARG) {
|
||||
flags &= ~FLAG_BRACK_ARG;
|
||||
char rg = LexGetArg('[');
|
||||
if (rg!= ']') {
|
||||
char const rg = LexGetArg('[');
|
||||
if (rg != ']') {
|
||||
mathPrintError("Expected ']'");
|
||||
panic = true;
|
||||
break;
|
||||
@ -541,7 +579,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
if (accent) {
|
||||
data.Insert(doAccent(yylval.l->id, tc));
|
||||
} else
|
||||
data.Insert (yylval.l->id, tc);
|
||||
data.Insert(yylval.l->id, tc);
|
||||
} else {
|
||||
MathFuncInset * bg = new MathFuncInset(yylval.l->name);
|
||||
if (accent) {
|
||||
@ -556,7 +594,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
if (accent) {
|
||||
data.Insert(doAccent(yylval.i, LM_TC_BOP));
|
||||
} else
|
||||
data.Insert (yylval.i, LM_TC_BOP);
|
||||
data.Insert(yylval.i, LM_TC_BOP);
|
||||
break;
|
||||
}
|
||||
case LM_TK_STY:
|
||||
@ -613,13 +651,12 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
|
||||
case LM_TK_LEFT:
|
||||
{
|
||||
int lfd, rgd;
|
||||
lfd = yylex();
|
||||
int lfd = yylex();
|
||||
if (lfd == LM_TK_SYM || lfd == LM_TK_STR || lfd == LM_TK_BOP|| lfd == LM_TK_SPECIAL)
|
||||
lfd = (lfd == LM_TK_SYM) ? yylval.l->id: yylval.i;
|
||||
// lyxerr << "L[" << lfd << " " << lfd << "]";
|
||||
LyxArrayBase * a = mathed_parse(FLAG_RIGHT);
|
||||
rgd = yylex();
|
||||
int rgd = yylex();
|
||||
// lyxerr << "R[" << rgd << "]";
|
||||
if (rgd == LM_TK_SYM || rgd == LM_TK_STR || rgd == LM_TK_BOP || rgd == LM_TK_SPECIAL)
|
||||
rgd = (rgd == LM_TK_SYM) ? yylval.l->id: yylval.i;
|
||||
@ -657,7 +694,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
break;
|
||||
}
|
||||
|
||||
case LM_TK_ACCENT: setAccent(yylval.l->id); break;
|
||||
case LM_TK_ACCENT:
|
||||
setAccent(yylval.l->id);
|
||||
break;
|
||||
|
||||
case LM_TK_NONUM:
|
||||
{
|
||||
@ -729,13 +768,12 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
rg = LexGetArg('{');
|
||||
}
|
||||
strcpy(ar, yytext);
|
||||
int nc = parse_align(ar, ar2);
|
||||
int const nc = parse_align(ar, ar2);
|
||||
MathParInset * mm = new MathMatrixInset(nc, 0);
|
||||
mm->SetAlign(ar2[0], ar);
|
||||
data.Insert(mm, LM_TC_ACTIVE_INSET);
|
||||
mathed_parse(FLAG_END, mm->GetData(), &mm);
|
||||
} else
|
||||
if (yylval.i >= LM_EN_INTEXT && yylval.i<= LM_EN_EQNARRAY) {
|
||||
} else if (yylval.i >= LM_EN_INTEXT && yylval.i<= LM_EN_EQNARRAY) {
|
||||
if (plevel!= 0) {
|
||||
mathPrintError("Misplaced environment");
|
||||
break;
|
||||
@ -797,7 +835,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
|
||||
case LM_TK_LABEL:
|
||||
{
|
||||
char rg = LexGetArg('\0', true);
|
||||
char const rg = LexGetArg('\0', true);
|
||||
if (rg != '}') {
|
||||
mathPrintError("Expected '{'");
|
||||
// debug info
|
||||
@ -806,15 +844,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
break;
|
||||
}
|
||||
if (crow) {
|
||||
// This is removed by crow's destructor. Bad design? yes, this
|
||||
// will be changed after 0.12
|
||||
crow->setLabel(strnew(yytext));
|
||||
}
|
||||
else {
|
||||
// where is this math_label free'ed?
|
||||
// Supposedly in ~formula, another bad hack,
|
||||
// give me some time please.
|
||||
mathed_label = strnew(yytext);
|
||||
crow->setLabel(yytext);
|
||||
} else {
|
||||
mathed_label = yytext;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
lyxerr << "Label[" << mathed_label << "]" << endl;
|
||||
@ -831,7 +863,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
|
||||
if (panic) {
|
||||
lyxerr << " Math Panic, expect problems!" << endl;
|
||||
// Search for the end command.
|
||||
do t = yylex (); while (t != LM_TK_END && t);
|
||||
do {
|
||||
t = yylex ();
|
||||
} while (t != LM_TK_END && t);
|
||||
} else
|
||||
t = yylex ();
|
||||
|
||||
|
@ -136,6 +136,4 @@ union YYSTYPE {
|
||||
latexkeys * l;
|
||||
};
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
#endif
|
||||
|
@ -1955,7 +1955,7 @@ void LyXParagraph::SetOnlyLayout(BufferParams const & bparams,
|
||||
p1 = ppar->pextra_width,
|
||||
p2 = ppar->pextra_widthp;
|
||||
ppar->SetPExtraType(bparams, ppar->pextra_type,
|
||||
p1.c_str(), p2.c_str());
|
||||
p1, p2);
|
||||
}
|
||||
if ((par->pextra_type == PEXTRA_NONE) &&
|
||||
npar && (npar->pextra_type != PEXTRA_NONE)) {
|
||||
@ -1963,7 +1963,7 @@ void LyXParagraph::SetOnlyLayout(BufferParams const & bparams,
|
||||
p1 = npar->pextra_width,
|
||||
p2 = npar->pextra_widthp;
|
||||
npar->SetPExtraType(bparams, npar->pextra_type,
|
||||
p1.c_str(), p2.c_str());
|
||||
p1, p2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2024,7 +2024,7 @@ void LyXParagraph::SetLayout(BufferParams const & bparams,
|
||||
p1 = ppar->pextra_width,
|
||||
p2 = ppar->pextra_widthp;
|
||||
ppar->SetPExtraType(bparams, ppar->pextra_type,
|
||||
p1.c_str(), p2.c_str());
|
||||
p1, p2);
|
||||
}
|
||||
if ((par->pextra_type == PEXTRA_NONE) &&
|
||||
npar && (npar->pextra_type != PEXTRA_NONE)) {
|
||||
@ -2032,7 +2032,7 @@ void LyXParagraph::SetLayout(BufferParams const & bparams,
|
||||
p1 = npar->pextra_width,
|
||||
p2 = npar->pextra_widthp;
|
||||
npar->SetPExtraType(bparams, npar->pextra_type,
|
||||
p1.c_str(), p2.c_str());
|
||||
p1, p2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3468,7 +3468,6 @@ LyXParagraph * LyXParagraph::TeXFootnote(Buffer const * buf,
|
||||
need_closing = true;
|
||||
}
|
||||
|
||||
//BufferParams * params = ¤t_view->buffer()->params;
|
||||
bool footer_in_body = true;
|
||||
switch (footnotekind) {
|
||||
case LyXParagraph::FOOTNOTE:
|
||||
@ -3507,7 +3506,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(Buffer const * buf,
|
||||
<< pextra_width << "}\n";
|
||||
else
|
||||
os << "\\begin{floatingfigure}{"
|
||||
<< atoi(pextra_widthp.c_str())/100.0
|
||||
<< lyx::atoi(pextra_widthp) / 100.0
|
||||
<< "\\textwidth}\n";
|
||||
} else {
|
||||
os << "\\begin{figure}";
|
||||
@ -3989,7 +3988,7 @@ string const LyXParagraph::String(Buffer const * buffer,
|
||||
}
|
||||
|
||||
|
||||
void LyXParagraph::SetInsetOwner(Inset *i)
|
||||
void LyXParagraph::SetInsetOwner(Inset * i)
|
||||
{
|
||||
inset_owner = i;
|
||||
for (InsetList::const_iterator cit = insetlist.begin();
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -51,7 +51,7 @@ FD_form_sendto *create_form_form_sendto(void)
|
||||
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_sendto->fdui = fdui;
|
||||
fdui->form_sendto->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext
|
||||
// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
|
||||
#include <config.h>
|
||||
#include "lyx_gui_misc.h"
|
||||
#include "gettext.h"
|
||||
@ -65,7 +65,7 @@ FD_form_spell_options *create_form_form_spell_options(void)
|
||||
fl_set_object_callback(obj, SpellOptionsApplyCB, 0);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_spell_options->fdui = fdui;
|
||||
fdui->form_spell_options->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
@ -118,7 +118,7 @@ FD_form_spell_check *create_form_form_spell_check(void)
|
||||
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
|
||||
fl_end_form();
|
||||
|
||||
//fdui->form_spell_check->fdui = fdui;
|
||||
fdui->form_spell_check->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ bool sc_still_alive() {
|
||||
static
|
||||
void sc_clean_up_after_error()
|
||||
{
|
||||
fclose(out);
|
||||
::fclose(out);
|
||||
}
|
||||
|
||||
// Send word to ispell and get reply
|
||||
@ -497,11 +497,11 @@ isp_result * sc_check_word(string const & word)
|
||||
{
|
||||
//Please rewrite to use string.
|
||||
|
||||
fputs(word.c_str(), out);
|
||||
fputc('\n', out);
|
||||
::fputs(word.c_str(), out);
|
||||
::fputc('\n', out);
|
||||
|
||||
char buf[1024];
|
||||
fgets(buf, 1024, in);
|
||||
::fgets(buf, 1024, in);
|
||||
|
||||
/* I think we have to check if ispell is still alive here because
|
||||
the signal-handler could have disabled blocking on the fd */
|
||||
@ -565,28 +565,28 @@ void close_spell_checker()
|
||||
static inline
|
||||
void sc_insert_word(string const & word)
|
||||
{
|
||||
fputc('*', out); // Insert word in personal dictionary
|
||||
fputs(word.c_str(), out);
|
||||
fputc('\n', out);
|
||||
::fputc('*', out); // Insert word in personal dictionary
|
||||
::fputs(word.c_str(), out);
|
||||
::fputc('\n', out);
|
||||
}
|
||||
|
||||
|
||||
static inline
|
||||
void sc_accept_word(string const & word)
|
||||
{
|
||||
fputc('@', out); // Accept in this session
|
||||
fputs(word.c_str(), out);
|
||||
fputc('\n', out);
|
||||
::fputc('@', out); // Accept in this session
|
||||
::fputs(word.c_str(), out);
|
||||
::fputc('\n', out);
|
||||
}
|
||||
|
||||
static inline
|
||||
void sc_store_replacement(string const & mis, string const & cor) {
|
||||
if(actual_spell_checker == ASC_ASPELL) {
|
||||
fputs("$$ra ", out);
|
||||
fputs(mis.c_str(), out);
|
||||
fputc(',', out);
|
||||
fputs(cor.c_str(), out);
|
||||
fputc('\n', out);
|
||||
::fputs("$$ra ", out);
|
||||
::fputs(mis.c_str(), out);
|
||||
::fputc(',', out);
|
||||
::fputs(cor.c_str(), out);
|
||||
::fputc('\n', out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -599,7 +599,7 @@ void init_spell_checker(BufferParams const &, string const & lang)
|
||||
{
|
||||
PspellConfig * config = new_pspell_config();
|
||||
string code;
|
||||
(void)split(lang, code, '_');
|
||||
split(lang, code, '_');
|
||||
config->replace("language-tag", code.c_str());
|
||||
spell_error_object = new_pspell_manager(config);
|
||||
if (pspell_error_number(spell_error_object) != 0) {
|
||||
@ -629,6 +629,7 @@ static
|
||||
isp_result * sc_check_word(string const & word)
|
||||
{
|
||||
isp_result * result = new isp_result;
|
||||
#warning Why isnt word_ok a bool? (Lgb)
|
||||
int word_ok = pspell_manager_check(sc, word.c_str());
|
||||
Assert(word_ok != -1);
|
||||
|
||||
@ -726,12 +727,12 @@ void ShowSpellChecker(BufferView * bv)
|
||||
fl_set_object_lcol(fd_form_spell_check->input, FL_INACTIVE);
|
||||
fl_set_object_lcol(fd_form_spell_check->browser, FL_INACTIVE);
|
||||
|
||||
while (true){
|
||||
while (true) {
|
||||
obj = fl_do_forms();
|
||||
if (obj == fd_form_spell_check->options){
|
||||
if (obj == fd_form_spell_check->options) {
|
||||
SpellCheckerOptions();
|
||||
}
|
||||
if (obj == fd_form_spell_check->start){
|
||||
if (obj == fd_form_spell_check->start) {
|
||||
// activate insert, accept, and stop
|
||||
fl_activate_object(fd_form_spell_check->insert);
|
||||
fl_activate_object(fd_form_spell_check->accept);
|
||||
|
@ -140,9 +140,9 @@ void FileInfo::init()
|
||||
void FileInfo::dostat(bool link)
|
||||
{
|
||||
if (link) {
|
||||
status = lstat(fname.c_str(), &buf);
|
||||
status = ::lstat(fname.c_str(), &buf);
|
||||
} else {
|
||||
status = stat(fname.c_str(), &buf);
|
||||
status = ::stat(fname.c_str(), &buf);
|
||||
}
|
||||
if (status) err = errno;
|
||||
}
|
||||
@ -386,3 +386,6 @@ bool FileInfo::access(int p)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -59,9 +59,9 @@ struct LRegex::Impl {
|
||||
{
|
||||
regmatch_t tmp;
|
||||
regexec(preg, str.c_str(), 1, &tmp, 0);
|
||||
unsigned int first = tmp.rm_so != -1 ?
|
||||
unsigned int const first = tmp.rm_so != -1 ?
|
||||
static_cast<unsigned int>(tmp.rm_so) : string::npos;
|
||||
unsigned int second = tmp.rm_eo != -1 ?
|
||||
unsigned int const second = tmp.rm_eo != -1 ?
|
||||
static_cast<unsigned int>(tmp.rm_eo) : string::npos;
|
||||
return make_pair(first, second - first);
|
||||
}
|
||||
@ -72,7 +72,7 @@ struct LRegex::Impl {
|
||||
size_t nr = regerror(error_code, preg, 0, 0);
|
||||
char * tmp = new char[nr];
|
||||
regerror(error_code, preg, tmp, nr);
|
||||
string ret(tmp);
|
||||
string const ret(tmp);
|
||||
delete [] tmp;
|
||||
return ret;
|
||||
}
|
||||
@ -88,7 +88,8 @@ struct LRegex::Impl {
|
||||
// func much faster, but client code will be simpler,
|
||||
// because then it will only be needed to scan through
|
||||
// all the entries in matches.
|
||||
size_t subs = (preg->re_nsub != 0 ? (preg->re_nsub + 1) : 1);
|
||||
size_t const subs =
|
||||
(preg->re_nsub != 0 ? (preg->re_nsub + 1) : 1);
|
||||
regmatch_t * mat = new regmatch_t[subs];
|
||||
unsigned int first = 0;
|
||||
unsigned int second = 0;
|
||||
|
@ -43,7 +43,7 @@ LSubstring::LSubstring(string & s, string::value_type const * p)
|
||||
LSubstring::LSubstring(string & s, LRegex const & r)
|
||||
: ps(&s)
|
||||
{
|
||||
LRegex::MatchPair res = r.first_match(s);
|
||||
LRegex::MatchPair const res = r.first_match(s);
|
||||
if (res.first != string::npos) {
|
||||
n = res.second;
|
||||
pos = res.first;
|
||||
|
@ -31,6 +31,7 @@ libsupport_la_SOURCES = \
|
||||
StrPool.C \
|
||||
StrPool.h \
|
||||
abort.C \
|
||||
atoi.C \
|
||||
block.h \
|
||||
chdir.C \
|
||||
copy.C \
|
||||
@ -52,6 +53,7 @@ libsupport_la_SOURCES = \
|
||||
path.h \
|
||||
putenv.C \
|
||||
rename.C \
|
||||
rmdir.C \
|
||||
sstream.h \
|
||||
$(REGEX) syscall.C \
|
||||
syscall.h \
|
||||
@ -60,4 +62,5 @@ libsupport_la_SOURCES = \
|
||||
syssingleton.C \
|
||||
translator.h \
|
||||
textutils.h \
|
||||
unlink.C \
|
||||
utility.hpp
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
StrPool::~StrPool()
|
||||
{
|
||||
for (Pool::const_iterator cit = pool_.begin() ;
|
||||
for (Pool::const_iterator cit = pool_.begin();
|
||||
cit != pool_.end() ; ++cit) {
|
||||
delete[] (*cit);
|
||||
}
|
||||
|
10
src/support/atoi.C
Normal file
10
src/support/atoi.C
Normal file
@ -0,0 +1,10 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "lyxlib.h"
|
||||
|
||||
int lyx::atoi(string const & nstr)
|
||||
{
|
||||
return ::atoi(nstr.c_str());
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user