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:
Lars Gullik Bjønnes 2000-09-26 13:54:57 +00:00
parent 567e0d583f
commit d6665cba42
121 changed files with 1079 additions and 9332 deletions

View File

@ -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> 2000-09-26 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/buffer.C (readFile): make sure that the whole version number * src/buffer.C (readFile): make sure that the whole version number

View File

@ -114,6 +114,20 @@ in C++.
-NOT- -NOT-
T add(...); 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 Exceptions
---------- ----------
@ -318,7 +332,7 @@ Formatting
* Using external GUI constructors (XForms fdesign) * Using external GUI constructors (XForms fdesign)
- Fdesign generated files should not be changed at all. The only changes - 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 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 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 reasons above, you should provide a patch against the clean generated

View File

@ -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();

View File

@ -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

View File

@ -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;

View File

@ -24,7 +24,7 @@ if [ -f "$2.patch" ]; then
patch -s $1 < "$2.patch" patch -s $1 < "$2.patch"
fi 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 <config.h>" >> $2
echo "#include \"lyx_gui_misc.h\"" >> $2 echo "#include \"lyx_gui_misc.h\"" >> $2
echo "#include \"gettext.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 # For all lines containing "fl_add" and a string containing |, add the
# shortcut command after the end of this line # 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)/' # -e 's/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/'
# #
# Some picky/broken compilers (eg AIX's xlC) don't like evaluating # 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 # 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. # 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 # 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/' # -e 's/stdlib.h/cstdlib/'
# #
@ -105,8 +97,6 @@ cat $1 | sed \
-e '/shortcut/ s/".*[|].*"/scex(_(&))/' \ -e '/shortcut/ s/".*[|].*"/scex(_(&))/' \
-e '/fl_add/ s/".*[|].*"/idex(_(&))/' \ -e '/fl_add/ s/".*[|].*"/idex(_(&))/' \
-e '/fl_add/ s/idex(\(.*\)").*$/&fl_set_button_shortcut(obj,scex(\1")),1);/' \ -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/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/' \
-e 's/,\([^ ]\)/, \1/g' \ -e 's/,\([^ ]\)/, \1/g' \
-e 's/\("[^"][^"]*,\) \("\)/\1\2/g' \ -e 's/\("[^"][^"]*,\) \("\)/\1\2/g' \

View File

@ -3,7 +3,7 @@ Magic: 13000
Internal Form Definition File Internal Form Definition File
(do not change) (do not change)
Number of forms: 5 Number of forms: 4
Unit of measure: FL_COORD_PIXEL Unit of measure: FL_COORD_PIXEL
=============== FORM =============== =============== FORM ===============
@ -249,7 +249,7 @@ argument:
-------------------- --------------------
class: FL_BEGIN_GROUP class: FL_BEGIN_GROUP
type: 0 type: 0
box: 0 0 0 0 box: 0 10 10 0
boxtype: FL_NO_BOX boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -687,7 +687,7 @@ argument: 2
-------------------- --------------------
class: FL_BEGIN_GROUP class: FL_BEGIN_GROUP
type: 0 type: 0
box: 0 0 0 0 box: 0 10 10 0
boxtype: FL_NO_BOX boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -867,7 +867,7 @@ argument:
-------------------- --------------------
class: FL_BEGIN_GROUP class: FL_BEGIN_GROUP
type: 0 type: 0
box: 0 0 0 0 box: 0 10 10 0
boxtype: FL_NO_BOX boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -975,7 +975,7 @@ argument:
-------------------- --------------------
class: FL_BEGIN_GROUP class: FL_BEGIN_GROUP
type: 0 type: 0
box: 0 0 0 0 box: 0 10 10 0
boxtype: FL_NO_BOX boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -1392,120 +1392,6 @@ name: timer
callback: callback:
argument: 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 =============== =============== FORM ===============
Name: form_search Name: form_search
Width: 440 Width: 440

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +1,22 @@
--- layout_forms.h.orig Sat Jun 10 01:48:56 2000 1c1
+++ layout_forms.h Sat Jun 10 02:10:12 2000 < /** Header file generated with fdesign on Tue Sep 26 15:14:15 2000.**/
@@ -3,6 +3,8 @@ ---
#ifndef FD_form_document_h_ > /** Header file generated with fdesign **/
#define FD_form_document_h_ 7,8c7,8
< extern void CharacterApplyCB(FL_OBJECT *, long);
+extern "C" { < extern void CharacterCloseCB(FL_OBJECT *, long);
+ ---
/** Callbacks, globals and object handlers **/ > extern "C" void CharacterApplyCB(FL_OBJECT *, long);
extern void ChoiceClassCB(FL_OBJECT *, long); > extern "C" void CharacterCloseCB(FL_OBJECT *, long);
extern void DocumentCancelCB(FL_OBJECT *, long); 10,12c10,12
@@ -46,6 +48,29 @@ < extern void PreambleOKCB(FL_OBJECT *, long);
extern void TableOptionsCB(FL_OBJECT *, long); < extern void PreambleApplyCB(FL_OBJECT *, long);
extern void TableSpeCloseCB(FL_OBJECT *, long); < extern void PreambleCancelCB(FL_OBJECT *, long);
---
+} > extern "C" void PreambleOKCB(FL_OBJECT *, long);
+ > extern "C" void PreambleApplyCB(FL_OBJECT *, long);
+/* Additional Functions/Methods */ > extern "C" void PreambleCancelCB(FL_OBJECT *, long);
+ 13a14,16
+#include "bufferparams.h" > /* Some extra funcs */
+ >
+extern bool UpdateLayoutDocument(BufferParams *params = NULL); > extern bool UpdateLayoutPreamble();
+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_ */

View File

@ -17,15 +17,15 @@ SHELL = /bin/sh
# Various commands # Various commands
FDESIGN = fdesign 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 \ log_form.fd layout_forms.fd lyx.fd lyx_sendfax.fd math_forms.fd \
print_form.fd sp_form.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 \ log_form.c layout_forms.c lyx.c lyx_sendfax.c math_forms.c \
print_form.c sp_form.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 \ log_form.C layout_forms.C lyx.C lyx_sendfax.C math_forms.C \
print_form.C sp_form.C print_form.C sp_form.C
@ -52,7 +52,7 @@ e: c
for hfil in *.h ; do \ for hfil in *.h ; do \
if [ -f "$$hfil.patch" ] ; then \ if [ -f "$$hfil.patch" ] ; then \
(echo "Patching $$hfil with $$hfil.patch" ; \ (echo "Patching $$hfil with $$hfil.patch" ; \
patch -s $$hfil < $$hfil.patch) \ patch --verbose $$hfil < $$hfil.patch) \
fi; \ fi; \
sed < $$hfil > $$hfil.tmp \ sed < $$hfil > $$hfil.tmp \
-e 's/\(extern\) \(void.*FL_OBJECT\)/\1 "C" \2/' \ -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 @echo "get junk code and errors at compile time.">&2
for fil in *.C *.h ; do \ for fil in *.C *.h ; do \
if [ $$fil = "math_forms.C" -o $$fil = "math_forms.h" ]; then \ 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 \ else \
cp $$fil ../src ; \ cmp -s $$fil ../src/$$fil || cp $$fil ../src ; \
fi \ fi \
done done

View File

@ -14,8 +14,6 @@ src/bufferlist.C
src/BufferView2.C src/BufferView2.C
src/bufferview_funcs.C src/bufferview_funcs.C
src/BufferView_pimpl.C src/BufferView_pimpl.C
src/bullet_forms.C
src/bullet_forms_cb.C
src/Chktex.C src/Chktex.C
src/ColorHandler.C src/ColorHandler.C
src/combox.C src/combox.C
@ -127,9 +125,7 @@ src/mathed/math_forms.C
src/mathed/math_panel.C src/mathed/math_panel.C
src/MenuBackend.C src/MenuBackend.C
src/minibuffer.C src/minibuffer.C
src/PaperLayout.C
src/paragraph.C src/paragraph.C
src/ParagraphExtra.C
src/print_form.C src/print_form.C
src/spellchecker.C src/spellchecker.C
src/sp_form.C src/sp_form.C

View File

@ -716,13 +716,13 @@ void BufferView::replaceWord(string const & replacestring)
/* clear the selection (if there is any) */ /* clear the selection (if there is any) */
toggleSelection(false); 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 // Go back so that replacement string is also spellchecked
for (string::size_type i = 0; i < replacestring.length() + 1; ++i) { for (string::size_type i = 0; i < replacestring.length() + 1; ++i) {
text->CursorLeftIntern(this); text->CursorLeft(this);
} }
update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
} }

View File

@ -14,7 +14,6 @@
#include <config.h> #include <config.h>
#include <fstream> #include <fstream>
#include <cstdlib> // atoi
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation #pragma implementation
@ -76,7 +75,7 @@ int Chktex::scanLogFile(TeXErrors & terr)
token = split(token, warno, ':'); token = split(token, warno, ':');
token = split(token, warning, ':'); token = split(token, warning, ':');
int lineno = atoi(line.c_str()); int lineno = lyx::atoi(line);
warno = _("ChkTeX warning id #") + warno; warno = _("ChkTeX warning id #") + warno;
terr.insertError(lineno, warno, warning); terr.insertError(lineno, warno, warning);
++retval; ++retval;

View File

@ -37,7 +37,7 @@ void DepTable::insert(string const & fi,
if (deplist.find(f) == deplist.end()) { if (deplist.find(f) == deplist.end()) {
if (upd) { if (upd) {
one = two; one = two;
two = lyx::sum(f.c_str()); two = lyx::sum(f);
} }
deplist[f] = make_pair(one, two); deplist[f] = make_pair(one, two);
} }
@ -49,8 +49,8 @@ void DepTable::update()
for(DepList::iterator itr = deplist.begin(); for(DepList::iterator itr = deplist.begin();
itr != deplist.end(); itr != deplist.end();
++itr) { ++itr) {
unsigned long one = (*itr).second.second; unsigned long const one = (*itr).second.second;
unsigned long two = lyx::sum((*itr).first.c_str()); unsigned long const two = lyx::sum((*itr).first);
(*itr).second = make_pair(one, two); (*itr).second = make_pair(one, two);
if (lyxerr.debugging(Debug::DEPEND)) { if (lyxerr.debugging(Debug::DEPEND)) {
lyxerr << "Update dep: " << (*itr).first << " " lyxerr << "Update dep: " << (*itr).first << " "
@ -93,7 +93,7 @@ bool DepTable::extchanged(string const & ext) const
for (DepList::const_iterator cit = deplist.begin(); for (DepList::const_iterator cit = deplist.begin();
cit != deplist.end(); cit != deplist.end();
++cit) { ++cit) {
if (suffixIs((*cit).first, ext.c_str())) { if (suffixIs((*cit).first, ext)) {
if ((*cit).second.first != (*cit).second.second) if ((*cit).second.first != (*cit).second.second)
return true; return true;
} }
@ -115,7 +115,7 @@ void DepTable::remove_files_with_extension(string const & suf)
DepList tmp; DepList tmp;
for (DepList::const_iterator cit = deplist.begin(); for (DepList::const_iterator cit = deplist.begin();
cit != deplist.end(); ++cit) { cit != deplist.end(); ++cit) {
if (!suffixIs((*cit).first, suf.c_str())) if (!suffixIs((*cit).first, suf))
tmp[(*cit).first] = (*cit).second; tmp[(*cit).first] = (*cit).second;
} }
deplist.swap(tmp); deplist.swap(tmp);
@ -126,8 +126,7 @@ void DepTable::write(string const & f) const
{ {
ofstream ofs(f.c_str()); ofstream ofs(f.c_str());
for (DepList::const_iterator cit = deplist.begin(); for (DepList::const_iterator cit = deplist.begin();
cit != deplist.end(); cit != deplist.end(); ++cit) {
++cit) {
if (lyxerr.debugging(Debug::DEPEND)) { if (lyxerr.debugging(Debug::DEPEND)) {
lyxerr << "Write dep: " lyxerr << "Write dep: "
<< (*cit).first << " " << (*cit).first << " "

View File

@ -11,7 +11,6 @@
#include <config.h> #include <config.h>
#include <cmath> // fabs() #include <cmath> // fabs()
#include <cstdlib> // atoi()
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
@ -131,7 +130,7 @@ void FontInfo::query()
// We have matches. Run them through // We have matches. Run them through
for(int i = 0; i < matches; ++i) { for(int i = 0; i < matches; ++i) {
string name(list[i]); string name(list[i]);
sizes[i] = atoi(token(name, '-', 7).c_str()); sizes[i] = lyx::atoi(token(name, '-', 7));
strings[i] = name; strings[i] = name;
if (sizes[i] == 0) { if (sizes[i] == 0) {
if (scaleindex == -1) { if (scaleindex == -1) {

View File

@ -11,7 +11,6 @@
#include <config.h> #include <config.h>
#include <cmath> // fabs() #include <cmath> // fabs()
#include <cstdlib> // atoi()
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "FontLoader.h" #pragma implementation "FontLoader.h"

View File

@ -83,7 +83,7 @@ void LaTeX::deleteFilesOnError() const
// What files do we have to delete? // What files do we have to delete?
// This will at least make latex do all the runs // 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... // but the reason for the error might be in a generated file...
@ -91,15 +91,15 @@ void LaTeX::deleteFilesOnError() const
// bibtex file // bibtex file
string bbl = ChangeExtension(ofname, ".bbl"); string bbl = ChangeExtension(ofname, ".bbl");
::unlink(bbl.c_str()); lyx::unlink(bbl);
// makeindex file // makeindex file
string ind = ChangeExtension(ofname, ".ind"); string ind = ChangeExtension(ofname, ".ind");
::unlink(ind.c_str()); lyx::unlink(ind);
// Also remove the aux file // Also remove the aux file
string aux = ChangeExtension(ofname, ".aux"); string aux = ChangeExtension(ofname, ".aux");
::unlink(aux.c_str()); lyx::unlink(aux);
} }

View File

@ -22,11 +22,6 @@
// only to get access to NEW_INSETS // only to get access to NEW_INSETS
#include "lyxparagraph.h" #include "lyxparagraph.h"
#endif #endif
#if 1
// only to get access to NEW_EXPORT
#include "exporter.h"
#endif
using std::ostream; using std::ostream;
using std::endl; using std::endl;
@ -137,8 +132,6 @@ void LyXAction::init()
#endif #endif
{ LFUN_IMPORT, "buffer-import", { LFUN_IMPORT, "buffer-import",
N_("Import document"), NoBuffer }, N_("Import document"), NoBuffer },
{ LFUN_BUFFERBULLETSSELECT, "buffer-itemize-bullets-select",
"", Noop },
{ LFUN_BUFFER_PRINT, "buffer-print-xtl", N_("Print"), { LFUN_BUFFER_PRINT, "buffer-print-xtl", N_("Print"),
ReadOnly }, ReadOnly },
{ LFUN_PRINTER_PARAMS_GET, "printer-params-get", { LFUN_PRINTER_PARAMS_GET, "printer-params-get",
@ -154,18 +147,8 @@ void LyXAction::init()
N_("Switch to an open document"), ReadOnly }, N_("Switch to an open document"), ReadOnly },
{ LFUN_READ_ONLY_TOGGLE, "buffer-toggle-read-only", { LFUN_READ_ONLY_TOGGLE, "buffer-toggle-read-only",
N_("Toggle read-only"), ReadOnly }, N_("Toggle read-only"), ReadOnly },
#ifdef NEW_EXPORT
{ LFUN_UPDATE, "buffer-update", N_("Update"), ReadOnly }, { LFUN_UPDATE, "buffer-update", N_("Update"), ReadOnly },
{ LFUN_PREVIEW, "buffer-view", N_("View") , 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_MENUWRITE, "buffer-write", N_("Save"), ReadOnly },
{ LFUN_MENUWRITEAS, "buffer-write-as", N_("Save As"), { LFUN_MENUWRITEAS, "buffer-write-as", N_("Save As"),
ReadOnly }, ReadOnly },
@ -283,15 +266,11 @@ void LyXAction::init()
{ LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly }, { LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly },
{ LFUN_LAYOUTNO, "layout-number", "", Noop }, // internal only { LFUN_LAYOUTNO, "layout-number", "", Noop }, // internal only
{ LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly }, { LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly },
{ LFUN_LAYOUT_PAPER, "layout-paper", "", ReadOnly },
{ LFUN_LAYOUT_PASTE, "layout-paste", { LFUN_LAYOUT_PASTE, "layout-paste",
N_("Paste paragraph environment type"), Noop }, N_("Paste paragraph environment type"), Noop },
{ LFUN_LAYOUT_PREAMBLE, "layout-preamble", "", ReadOnly }, { LFUN_LAYOUT_PREAMBLE, "layout-preamble", "", ReadOnly },
{ LFUN_LAYOUT_QUOTES, "layout-quotes", "", ReadOnly },
{ LFUN_LAYOUT_SAVE_DEFAULT, "layout-save-default", "", { LFUN_LAYOUT_SAVE_DEFAULT, "layout-save-default", "",
ReadOnly }, ReadOnly },
{ LFUN_LAYOUT_TABLE, "layout-table",
N_("Open the table layout"), Noop },
{ LFUN_LAYOUT_TABULAR, "layout-tabular", { LFUN_LAYOUT_TABULAR, "layout-tabular",
N_("Open the tabular layout"), Noop }, N_("Open the tabular layout"), Noop },
{ LFUN_HOME, "line-begin", { LFUN_HOME, "line-begin",
@ -547,7 +526,6 @@ kb_action LyXAction::retrieveActionArg(int pseudo, string & arg) const
lyxerr << "Lyx Error: Unrecognized pseudo-action\n"; lyxerr << "Lyx Error: Unrecognized pseudo-action\n";
return LFUN_UNKNOWN_ACTION; return LFUN_UNKNOWN_ACTION;
} }
} }

View File

@ -11,7 +11,6 @@
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "support/syscall.h" #include "support/syscall.h"
#include "gettext.h" #include "gettext.h"
//#include "lyx_cb.h"
#include "bufferview_funcs.h" #include "bufferview_funcs.h"
#include "exporter.h" #include "exporter.h"
@ -57,18 +56,6 @@ void SendtoApplyCB(FL_OBJECT *, long)
if (command.empty()) if (command.empty())
return; return;
Buffer * buffer = current_view->buffer(); 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; string ftypeext;
if (fl_get_button(fd_form_sendto->radio_ftype_lyx)) if (fl_get_button(fd_form_sendto->radio_ftype_lyx))
ftypeext = ".lyx"; ftypeext = ".lyx";
@ -79,19 +66,12 @@ void SendtoApplyCB(FL_OBJECT *, long)
else if (fl_get_button(fd_form_sendto->radio_ftype_ascii)) else if (fl_get_button(fd_form_sendto->radio_ftype_ascii))
ftypeext = ".txt"; ftypeext = ".txt";
else { else {
#ifdef NEW_EXPORT
ftypeext = ".ps"; ftypeext = ".ps";
if (!Exporter::Export(buffer, "ps", true)) if (!Exporter::Export(buffer, "ps", true))
return; return;
#else
ftypeext = ".ps_tmp";
if (!CreatePostscript(buffer, true)) {
return;
}
#endif
} }
string fname = OnlyFilename(ChangeExtension(buffer->getLatexName(), string const fname = OnlyFilename(ChangeExtension(buffer->getLatexName(),
ftypeext)); ftypeext));
if (!contains(command, "$$FName")) if (!contains(command, "$$FName"))
command = "( " + command + " ) <$$FName"; command = "( " + command + " ) <$$FName";

View File

@ -40,8 +40,6 @@
using std::endl; using std::endl;
extern FD_form_document * fd_form_document;
extern void AutoSave(BufferView *); extern void AutoSave(BufferView *);
extern void QuitLyX(); extern void QuitLyX();
LyXTextClass::size_type current_layout = 0; LyXTextClass::size_type current_layout = 0;
@ -311,7 +309,6 @@ void LyXView::init()
// Set the textclass choice // Set the textclass choice
invalidateLayoutChoice(); invalidateLayoutChoice();
updateLayoutChoice(); updateLayoutChoice();
UpdateDocumentClassChoice();
updateMenubar(); updateMenubar();
// Start autosave timer // 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 #if 0
// This is necessary, since FL_FREE-Objects doesn't get all keypress events // This is necessary, since FL_FREE-Objects doesn't get all keypress events
// as FL_KEYBOARD events :-( Matthias 280596 // as FL_KEYBOARD events :-( Matthias 280596

View File

@ -131,10 +131,8 @@ private:
BufferView * bufferview; BufferView * bufferview;
/// ///
void invalidateLayoutChoice(); void invalidateLayoutChoice();
///
void UpdateDocumentClassChoice();
public: public:
#if FL_REVISION < 89 #if 0
/// ///
static int KeyPressMask_raw_callback(FL_FORM *, void * xev); static int KeyPressMask_raw_callback(FL_FORM *, void * xev);
#endif #endif

View File

@ -69,8 +69,6 @@ lyx_SOURCES = \
Painter.h \ Painter.h \
PainterBase.C \ PainterBase.C \
PainterBase.h \ PainterBase.h \
PaperLayout.C \
ParagraphExtra.C \
PrinterParams.h \ PrinterParams.h \
Sectioning.h \ Sectioning.h \
Sectioning.C \ Sectioning.C \
@ -100,9 +98,6 @@ lyx_SOURCES = \
bufferparams.h \ bufferparams.h \
bufferview_funcs.C \ bufferview_funcs.C \
bufferview_funcs.h \ bufferview_funcs.h \
bullet_forms.C \
bullet_forms.h \
bullet_forms_cb.C \
chset.C \ chset.C \
chset.h \ chset.h \
combox.C \ combox.C \

View File

@ -116,7 +116,7 @@ Menu & Menu::read(LyXLex & lex)
// fallback to md_item // fallback to md_item
case md_item: { case md_item: {
lex.next(); lex.next();
char * tmp = strdup(lex.GetString().c_str()); char * tmp = ::strdup(lex.GetString().c_str());
string name = _(tmp); string name = _(tmp);
free(tmp); free(tmp);
lex.next(); lex.next();
@ -161,7 +161,7 @@ Menu & Menu::read(LyXLex & lex)
case md_submenu: { case md_submenu: {
lex.next(); lex.next();
char * tmp = strdup(lex.GetString().c_str()); char * tmp = ::strdup(lex.GetString().c_str());
string mlabel = _(tmp); string mlabel = _(tmp);
free(tmp); free(tmp);
lex.next(); lex.next();

View File

@ -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 = &current_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 = &current_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;
}

View File

@ -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;
}

View File

@ -21,8 +21,10 @@
#ifdef ENABLE_ASSERTIONS #ifdef ENABLE_ASSERTIONS
#include "support/LAssert.h" #include "support/LAssert.h"
extern bool containsOnly(string const &, char const *);
#endif #endif
/** /**
This struct contains (or should contain) all the parameters required for 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 printing a buffer. Some work still needs to be done on this struct and
@ -131,7 +133,6 @@ struct PrinterParams {
void testInvariant() const void testInvariant() const
{ {
#ifdef ENABLE_ASSERTIONS #ifdef ENABLE_ASSERTIONS
extern bool containsOnly(string const &, char const *);
if (!from_page.empty()) { if (!from_page.empty()) {
// Assert(from_page == number or empty) // Assert(from_page == number or empty)
Assert(containsOnly(from_page, "1234567890")); Assert(containsOnly(from_page, "1234567890"));
@ -166,6 +167,3 @@ struct PrinterParams {
}; };
#endif #endif

View File

@ -109,9 +109,6 @@ using std::istringstream;
// all these externs should eventually be removed. // all these externs should eventually be removed.
extern BufferList bufferlist; extern BufferList bufferlist;
#ifndef NEW_EXPORT
extern void MenuExport(Buffer *, string const &);
#endif
extern LyXAction lyxaction; 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"); "defaults.lyx");
Buffer defaults = Buffer(fname); 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) // Returns false if "\the_end" is not read for formats >= 2.13. (Asger)
bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par) bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
{ {
string tmptok;
int pos = 0; int pos = 0;
char depth = 0; // signed or unsigned? char depth = 0; // signed or unsigned?
#ifndef NEW_INSETS #ifndef NEW_INSETS
@ -285,13 +281,11 @@ bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
pretoken = lex.GetString(); pretoken = lex.GetString();
} }
// Profiling show this should give a lot: (Asger) if (pretoken.empty()) continue;
string const token = pretoken;
if (token.empty()) the_end_read =
continue; parseSingleLyXformat2Token(lex, par, return_par,
the_end_read = parseSingleLyXformat2Token(lex, par, return_par, pretoken, pos, depth,
token, pos, depth,
font font
#ifndef NEW_INSETS #ifndef NEW_INSETS
, footnoteflag, , footnoteflag,
@ -346,7 +340,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
} }
pos = 0; pos = 0;
lex.EatLine(); lex.EatLine();
string layoutname = lex.GetString(); string const layoutname = lex.GetString();
pair<bool, LyXTextClass::LayoutList::size_type> pp pair<bool, LyXTextClass::LayoutList::size_type> pp
= textclasslist.NumberOfLayout(params.textclass, = textclasslist.NumberOfLayout(params.textclass,
layoutname); layoutname);
@ -403,7 +397,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
// This is the compability reader, unfinished but tested. // This is the compability reader, unfinished but tested.
// (Lgb) // (Lgb)
lex.next(); lex.next();
string tmptok = lex.GetString(); string const tmptok = lex.GetString();
//lyxerr << "old float: " << tmptok << endl; //lyxerr << "old float: " << tmptok << endl;
Inset * inset = 0; Inset * inset = 0;
@ -443,7 +437,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
// This _is_ a hack! (Lgb) // This _is_ a hack! (Lgb)
while(true) { while(true) {
lex.next(); lex.next();
string tmp = lex.GetString(); string const tmp = lex.GetString();
if (tmp == "\\end_deeper") { if (tmp == "\\end_deeper") {
lyxerr << "\\end_deeper caught!" << endl; lyxerr << "\\end_deeper caught!" << endl;
if (!depth) { if (!depth) {
@ -657,7 +651,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
params.pagestyle = strip(lex.GetString()); params.pagestyle = strip(lex.GetString());
} else if (token == "\\bullet") { } else if (token == "\\bullet") {
lex.nextToken(); lex.nextToken();
int index = lex.GetInteger(); int const index = lex.GetInteger();
lex.nextToken(); lex.nextToken();
int temp_int = lex.GetInteger(); int temp_int = lex.GetInteger();
params.user_defined_bullets[index].setFont(temp_int); 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.user_defined_bullets[index].setSize(temp_int);
params.temp_bullets[index].setSize(temp_int); params.temp_bullets[index].setSize(temp_int);
lex.nextToken(); lex.nextToken();
string temp_str = lex.GetString(); string const temp_str = lex.GetString();
if (temp_str != "\\end_bullet") { if (temp_str != "\\end_bullet") {
// this element isn't really necessary for // this element isn't really necessary for
// parsing but is easier for humans // parsing but is easier for humans
@ -682,9 +676,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
} }
} else if (token == "\\bulletLaTeX") { } else if (token == "\\bulletLaTeX") {
lex.nextToken(); lex.nextToken();
int index = lex.GetInteger(); int const index = lex.GetInteger();
lex.next(); lex.next();
string temp_str = lex.GetString(), sum_str; string temp_str = lex.GetString();
string sum_str;
while (temp_str != "\\end_bullet") { while (temp_str != "\\end_bullet") {
// this loop structure is needed when user // this loop structure is needed when user
// enters an empty string since the first // enters an empty string since the first
@ -706,7 +701,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
params.tocdepth = lex.GetInteger(); params.tocdepth = lex.GetInteger();
} else if (token == "\\spacing") { } else if (token == "\\spacing") {
lex.next(); lex.next();
string tmp = strip(lex.GetString()); string const tmp = strip(lex.GetString());
Spacing::Space tmp_space = Spacing::Default; Spacing::Space tmp_space = Spacing::Default;
float tmp_val = 0.0; float tmp_val = 0.0;
if (tmp == "single") { if (tmp == "single") {
@ -731,7 +726,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
} }
} else if (token == "\\paragraph_spacing") { } else if (token == "\\paragraph_spacing") {
lex.next(); lex.next();
string tmp = strip(lex.GetString()); string const tmp = strip(lex.GetString());
if (tmp == "single") { if (tmp == "single") {
par->spacing.set(Spacing::Single); par->spacing.set(Spacing::Single);
} else if (tmp == "onehalf") { } else if (tmp == "onehalf") {
@ -762,7 +757,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
font.setLyXSize(lex.GetString()); font.setLyXSize(lex.GetString());
} else if (token == "\\latex") { } else if (token == "\\latex") {
lex.next(); lex.next();
string tok = lex.GetString(); string const tok = lex.GetString();
// This is dirty, but gone with LyX3. (Asger) // This is dirty, but gone with LyX3. (Asger)
if (tok == "no_latex") if (tok == "no_latex")
font.setLatex(LyXFont::OFF); font.setLatex(LyXFont::OFF);
@ -775,7 +770,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
"`$$Token'"); "`$$Token'");
} else if (token == "\\lang") { } else if (token == "\\lang") {
lex.next(); lex.next();
string tok = lex.GetString(); string const tok = lex.GetString();
Languages::iterator lit = languages.find(tok); Languages::iterator lit = languages.find(tok);
if (lit != languages.end()) { if (lit != languages.end()) {
font.setLanguage(&(*lit).second); font.setLanguage(&(*lit).second);
@ -788,7 +783,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
font.setEmph(font.setLyXMisc(lex.GetString())); font.setEmph(font.setLyXMisc(lex.GetString()));
} else if (token == "\\bar") { } else if (token == "\\bar") {
lex.next(); lex.next();
string tok = lex.GetString(); string const tok = lex.GetString();
// This is dirty, but gone with LyX3. (Asger) // This is dirty, but gone with LyX3. (Asger)
if (tok == "under") if (tok == "under")
font.setUnderbar(LyXFont::ON); font.setUnderbar(LyXFont::ON);
@ -942,7 +937,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
} }
lex.next(); lex.next();
string tmptok = lex.GetString(); string const tmptok = lex.GetString();
last_inset_read = tmptok; last_inset_read = tmptok;
// test the different insets // test the different insets
if (tmptok == "Quotes") { if (tmptok == "Quotes") {
@ -1013,7 +1008,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
++pos; ++pos;
} else if (tmptok == "Float") { } else if (tmptok == "Float") {
lex.next(); lex.next();
string tmptok = lex.GetString(); string const tmptok = lex.GetString();
Inset * inset = new InsetFloat(tmptok); Inset * inset = new InsetFloat(tmptok);
inset->Read(this, lex); inset->Read(this, lex);
par->InsertInset(pos, inset, font); par->InsertInset(pos, inset, font);
@ -1090,7 +1085,7 @@ bool Buffer::readFile(LyXLex & lex, LyXParagraph * par)
{ {
if (lex.IsOK()) { if (lex.IsOK()) {
lex.next(); lex.next();
string token(lex.GetString()); string const token(lex.GetString());
if (token == "\\lyxformat") { // the first token _must_ be... if (token == "\\lyxformat") { // the first token _must_ be...
lex.EatLine(); lex.EatLine();
format = lex.GetFloat(); format = lex.GetFloat();
@ -1205,7 +1200,7 @@ bool Buffer::save() const
} else { } else {
// Saving failed, so backup is not backup // Saving failed, so backup is not backup
if (lyxrc.make_backup) { if (lyxrc.make_backup) {
::rename(s.c_str(), fileName().c_str()); lyx::rename(s, fileName());
} }
return false; return false;
} }
@ -1295,9 +1290,10 @@ bool Buffer::writeFile(string const & fname, bool flag) const
void Buffer::writeFileAscii(string const & fname, int linelen) void Buffer::writeFileAscii(string const & fname, int linelen)
{ {
LyXFont font1, font2;
Inset * inset; Inset * inset;
char c, footnoteflag = 0, depth = 0; char c;
char footnoteflag = 0;
char depth = 0;
string tmp; string tmp;
LyXParagraph::size_type i; LyXParagraph::size_type i;
int j; int j;
@ -1315,7 +1311,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
return; return;
} }
string fname1 = TmpFileName(); string const fname1 = TmpFileName();
LyXParagraph * par = paragraph; LyXParagraph * par = paragraph;
while (par) { while (par) {
int noparbreak = 0; int noparbreak = 0;
@ -1367,10 +1363,10 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
} else if (tmp == "Enumerate") { } else if (tmp == "Enumerate") {
ltype = 2; ltype = 2;
ltype_depth = depth+1; ltype_depth = depth+1;
} else if (strstr(tmp.c_str(), "ection")) { } else if (contains(tmp, "ection")) {
ltype = 3; ltype = 3;
ltype_depth = depth+1; ltype_depth = depth+1;
} else if (strstr(tmp.c_str(), "aragraph")) { } else if (contains(tmp, "aragraph")) {
ltype = 4; ltype = 4;
ltype_depth = depth+1; ltype_depth = depth+1;
} else if (tmp == "Description") { } else if (tmp == "Description") {
@ -1409,7 +1405,8 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
#endif #endif
} }
font1 = LyXFont(LyXFont::ALL_INHERIT, params.language_info); LyXFont font1 =
LyXFont(LyXFont::ALL_INHERIT, params.language_info);
actcell = 0; actcell = 0;
for (i = 0, actpos = 1; i < par->size(); ++i, ++actpos) { for (i = 0, actpos = 1; i < par->size(); ++i, ++actpos) {
if (!i && !footnoteflag && !noparbreak){ if (!i && !footnoteflag && !noparbreak){
@ -1441,7 +1438,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
currlinelen += (ltype_depth-depth)*2; currlinelen += (ltype_depth-depth)*2;
} }
} }
font2 = par->GetFontSettings(params, i); LyXFont font2 = par->GetFontSettings(params, i);
if (font1.latex() != font2.latex()) { if (font1.latex() != font2.latex()) {
if (font2.latex() == LyXFont::OFF) if (font2.latex() == LyXFont::OFF)
islatex = 0; islatex = 0;
@ -1677,7 +1674,7 @@ void Buffer::makeLaTeXFile(string const & fname,
} }
if (params.inputenc == "auto") { if (params.inputenc == "auto") {
string doc_encoding = string const doc_encoding =
params.language_info->encoding()->LatexName(); params.language_info->encoding()->LatexName();
// Create a list with all the input encodings used // 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 * inset = par->GetInset(0);
Inset::Code lyx_code = inset->LyxCode(); Inset::Code lyx_code = inset->LyxCode();
if (lyx_code == Inset::TOC_CODE){ if (lyx_code == Inset::TOC_CODE){
string temp = "toc"; string const temp = "toc";
sgmlOpenTag(ofs, depth, temp); sgmlOpenTag(ofs, depth, temp);
par = par->next; par = par->next;
@ -2251,7 +2248,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
} }
if (environment_stack[depth] != style.latexname()) { if (environment_stack[depth] != style.latexname()) {
if(depth == 0) { if(depth == 0) {
string temp = "p"; string const temp = "p";
sgmlOpenTag(ofs, depth, temp); sgmlOpenTag(ofs, depth, temp);
} }
environment_stack[depth] = style.latexname(); 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, void Buffer::linuxDocHandleFootnote(ostream & os, LyXParagraph * & par,
int const depth) int const depth)
{ {
string tag = "footnote"; string const tag = "footnote";
while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) { while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
sgmlOpenTag(os, depth + 1, tag); sgmlOpenTag(os, depth + 1, tag);
@ -2521,7 +2518,7 @@ void linux_doc_line_break(ostream & os, unsigned int & colcount,
void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par, void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
int desc_on, int const /*depth*/) int desc_on, int const /*depth*/)
{ {
LyXFont font1, font2; LyXFont font1;
char c; char c;
Inset * inset; Inset * inset;
LyXParagraph::size_type main_body; LyXParagraph::size_type main_body;
@ -2565,7 +2562,7 @@ void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
font1 = style.font; font1 = style.font;
} }
font2 = par->getFont(params, i); LyXFont const font2 = par->getFont(params, i);
if (font1.family() != font2.family()) { if (font1.family() != font2.family()) {
switch(family_type) { switch(family_type) {
@ -2856,7 +2853,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
tmps = style.latexparam(); tmps = style.latexparam();
c_params = split(tmps, c_depth,'|'); c_params = split(tmps, c_depth,'|');
cmd_depth= atoi(c_depth.c_str()); cmd_depth= lyx::atoi(c_depth);
if(command_flag) { if(command_flag) {
if(cmd_depth<command_base) { 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() int Buffer::runLiterate()
{ {
if (!users->text) return 0; if (!users->text) return 0;
@ -3314,7 +3243,7 @@ int Buffer::buildProgram()
lyxrc.literate_command, lyxrc.literate_error_filter, lyxrc.literate_command, lyxrc.literate_error_filter,
lyxrc.build_command, lyxrc.build_error_filter); lyxrc.build_command, lyxrc.build_error_filter);
TeXErrors terr; 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(). // check return value from literate.build().
if ((res & Literate::NO_LOGFILE)) { if ((res & Literate::NO_LOGFILE)) {
@ -3357,10 +3286,10 @@ int Buffer::runChktex()
ProhibitInput(users); ProhibitInput(users);
// get LaTeX-Filename // get LaTeX-Filename
string name = getLatexName(); string const name = getLatexName();
string path = OnlyPath(filename); string path = OnlyPath(filename);
string org_path = path; string const org_path = path;
if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
path = tmppath; path = tmppath;
} }
@ -3369,7 +3298,7 @@ int Buffer::runChktex()
users->owner()->getMiniBuffer()->Set(_("Running chktex...")); users->owner()->getMiniBuffer()->Set(_("Running chktex..."));
// Remove all error insets // Remove all error insets
bool removedErrorInsets = users->removeAutoInsets(); bool const removedErrorInsets = users->removeAutoInsets();
// Generate the LaTeX file if neccessary // Generate the LaTeX file if neccessary
makeLaTeXFile(name, org_path, false); makeLaTeXFile(name, org_path, false);
@ -3427,9 +3356,9 @@ void Buffer::validate(LaTeXFeatures & features) const
// so they are tested here // so they are tested here
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
if (params.user_defined_bullets[i] != ITEMIZE_DEFAULTS[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) { if (font == 0) {
int c = params int const c = params
.user_defined_bullets[i] .user_defined_bullets[i]
.getCharacter(); .getCharacter();
if (c == 16 if (c == 16
@ -3439,11 +3368,9 @@ void Buffer::validate(LaTeXFeatures & features) const
|| c == 31) { || c == 31) {
features.latexsym = true; features.latexsym = true;
} }
} } else if (font == 1) {
if (font == 1) {
features.amssymb = true; features.amssymb = true;
} } else if ((font >= 2 && font <= 5)) {
else if ((font >= 2 && font <= 5)) {
features.pifont = true; features.pifont = true;
} }
} }
@ -3458,9 +3385,9 @@ void Buffer::validate(LaTeXFeatures & features) const
void Buffer::setPaperStuff() void Buffer::setPaperStuff()
{ {
params.papersize = BufferParams::PAPER_DEFAULT; params.papersize = BufferParams::PAPER_DEFAULT;
char c1 = params.paperpackage; char const c1 = params.paperpackage;
if (c1 == BufferParams::PACKAGE_NONE) { if (c1 == BufferParams::PACKAGE_NONE) {
char c2 = params.papersize2; char const c2 = params.papersize2;
if (c2 == BufferParams::VM_PAPER_USLETTER) if (c2 == BufferParams::VM_PAPER_USLETTER)
params.papersize = BufferParams::PAPER_USLETTER; params.papersize = BufferParams::PAPER_USLETTER;
else if (c2 == BufferParams::VM_PAPER_USLEGAL) else if (c2 == BufferParams::VM_PAPER_USLEGAL)
@ -3518,7 +3445,7 @@ vector<string> const Buffer::getLabelList()
vector<string> label_list; vector<string> label_list;
for (inset_iterator it = inset_iterator_begin(); for (inset_iterator it = inset_iterator_begin();
it != inset_iterator_end(); ++it) { 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()); label_list.insert(label_list.end(), l.begin(), l.end());
} }
return label_list; return label_list;
@ -3558,7 +3485,8 @@ vector<vector<Buffer::TocItem> > const Buffer::getTocList()
} }
} else if (!par->IsDummy()) { } else if (!par->IsDummy()) {
#endif #endif
char labeltype = textclasslist.Style(params.textclass, char const labeltype =
textclasslist.Style(params.textclass,
par->GetLayout()).labeltype; par->GetLayout()).labeltype;
if (labeltype >= LABEL_COUNTER_CHAPTER if (labeltype >= LABEL_COUNTER_CHAPTER
@ -3611,7 +3539,7 @@ vector<pair<string,string> > const Buffer::getBibkeyList()
static_cast<InsetBibtex*>(*it)->getKeys(); static_cast<InsetBibtex*>(*it)->getKeys();
keys.insert(keys.end(), tmp.begin(), tmp.end()); keys.insert(keys.end(), tmp.begin(), tmp.end());
} else if ((*it)->LyxCode() == Inset::INCLUDE_CODE) { } else if ((*it)->LyxCode() == Inset::INCLUDE_CODE) {
vector<pair<string,string> > tmp = vector<pair<string,string> > const tmp =
static_cast<InsetInclude*>(*it)->getKeys(); static_cast<InsetInclude*>(*it)->getKeys();
keys.insert(keys.end(), tmp.begin(), tmp.end()); keys.insert(keys.end(), tmp.begin(), tmp.end());
} }
@ -3658,10 +3586,11 @@ void Buffer::markDepClean(string const & name)
bool Buffer::Dispatch(string const & command) bool Buffer::Dispatch(string const & command)
{ {
// Split command string into command and argument // Split command string into command and argument
string cmd, line = frontStrip(command); string cmd;
string arg = strip(frontStrip(split(line, 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; bool dispatched = true;
switch (action) { switch (action) {
case LFUN_EXPORT: case LFUN_EXPORT:
#ifdef NEW_EXPORT
Exporter::Export(this, argument, false); Exporter::Export(this, argument, false);
#else
MenuExport(this, argument);
#endif
break; break;
default: default:
@ -3714,7 +3639,6 @@ void Buffer::ChangeLanguage(Language const * from, Language const * to)
bool Buffer::isMultiLingual() bool Buffer::isMultiLingual()
{ {
LyXParagraph * par = paragraph; LyXParagraph * par = paragraph;
while (par) { while (par) {
if (par->isMultiLingual(params)) if (par->isMultiLingual(params))
@ -3727,7 +3651,8 @@ bool Buffer::isMultiLingual()
Buffer::inset_iterator::inset_iterator(LyXParagraph * paragraph, Buffer::inset_iterator::inset_iterator(LyXParagraph * paragraph,
LyXParagraph::size_type pos) LyXParagraph::size_type pos)
: par(paragraph) { : par(paragraph)
{
it = par->InsetIterator(pos); it = par->InsetIterator(pos);
if (it == par->inset_iterator_end()) { if (it == par->inset_iterator_end()) {
par = par->next; 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) { while (par) {
it = par->inset_iterator_begin(); it = par->inset_iterator_begin();
if (it != par->inset_iterator_end()) if (it != par->inset_iterator_end())

View File

@ -161,9 +161,6 @@ public:
void latexParagraphs(std::ostream & os, LyXParagraph * par, void latexParagraphs(std::ostream & os, LyXParagraph * par,
LyXParagraph * endpar, TexRow & texrow) const; LyXParagraph * endpar, TexRow & texrow) const;
///
int runLaTeX();
/// ///
int runLiterate(); int runLiterate();

View File

@ -362,7 +362,7 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
use_emergency = true; use_emergency = true;
} else { } else {
// Here, we should delete the emergency save // 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(); b->markDirty();
} else { } else {
// Here, we should delete the autosave // 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) Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
{ {
// make sure our path is absolute // make sure our path is absolute
string s = MakeAbsPath(filename); string const s = MakeAbsPath(filename);
// file already open? // file already open?
if (exists(s)) { if (exists(s)) {

View File

@ -165,7 +165,7 @@ void BufferParams::writeFile(ostream & os) const
else { else {
os << "\\bulletLaTeX " << i os << "\\bulletLaTeX " << i
<< "\n\t" << "\n\t"
<< user_defined_bullets[i].getText().c_str() << user_defined_bullets[i].getText()
<< "\n\\end_bullet\n"; << "\n\\end_bullet\n";
} }
} }

View File

@ -27,7 +27,6 @@
#include "lyx_cb.h" #include "lyx_cb.h"
#include "layout_forms.h" #include "layout_forms.h"
extern FD_form_paragraph * fd_form_paragraph;
extern FD_form_character * fd_form_character; extern FD_form_character * fd_form_character;
#ifndef NEW_INSETS #ifndef NEW_INSETS
@ -168,10 +167,7 @@ void ProhibitInput(BufferView * bv)
/* set the cursor to the watch for all forms and the canvas */ /* set the cursor to the watch for all forms and the canvas */
XDefineCursor(fl_display, bv->owner()->getForm()->window, XDefineCursor(fl_display, bv->owner()->getForm()->window,
cursor); 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) if (fd_form_character->form_character->visible)
XDefineCursor(fl_display, XDefineCursor(fl_display,
fd_form_character->form_character->window, 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 */ /* reset the cursor from the watch for all forms and the canvas */
XUndefineCursor(fl_display, bv->owner()->getForm()->window); 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) if (fd_form_character->form_character->visible)
XUndefineCursor(fl_display, XUndefineCursor(fl_display,
fd_form_character->form_character->window); fd_form_character->form_character->window);

View File

@ -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;
}
/*---------------------------------------*/

View File

@ -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_ */

View File

@ -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());
}

View File

@ -10,6 +10,7 @@
#include "support/filetools.h" #include "support/filetools.h"
#include "support/LRegex.h" #include "support/LRegex.h"
#include "support/LSubstring.h" #include "support/LSubstring.h"
#include "support/lyxlib.h"
#include "debug.h" #include "debug.h"
using std::ifstream; using std::ifstream;
@ -29,7 +30,7 @@ bool CharacterSet::loadFile(string const & fname)
// open definition file // open definition file
lyxerr[Debug::KBMAP] lyxerr[Debug::KBMAP]
<< "Reading character set file " << fname << ".cdef" << endl; << "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()); ifstream ifs(filename.c_str());
if (!ifs) { if (!ifs) {
lyxerr << "Unable to open character set file" << endl; lyxerr << "Unable to open character set file" << endl;
@ -48,8 +49,8 @@ bool CharacterSet::loadFile(string const & fname)
while(getline(ifs, line)) { while(getline(ifs, line)) {
if (reg.exact_match(line)) { if (reg.exact_match(line)) {
LRegex::SubMatches const & sub = reg.exec(line); LRegex::SubMatches const & sub = reg.exec(line);
n = atoi(line.substr(sub[1].first, n = lyx::atoi(line.substr(sub[1].first,
sub[1].second).c_str()); sub[1].second));
str = LSubstring(line, sub[2].first, sub[2].second); str = LSubstring(line, sub[2].first, sub[2].second);
if (lyxerr.debugging(Debug::KBMAP)) if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "Chardef: " << n lyxerr << "Chardef: " << n

View File

@ -12,8 +12,6 @@
#include <iosfwd> #include <iosfwd>
//#define NEW_EXPORT 1
/** These are all the lyxfunctions (as enums). /** These are all the lyxfunctions (as enums).
Please add new functions at the end of the enum, right Please add new functions at the end of the enum, right
before LFUN_LASTACTION. before LFUN_LASTACTION.
@ -29,15 +27,9 @@ enum kb_action {
LFUN_MENUWRITEAS, LFUN_MENUWRITEAS,
LFUN_MENUPRINT, LFUN_MENUPRINT,
LFUN_MENUSENDTO, LFUN_MENUSENDTO,
#ifndef NEW_EXPORT
LFUN_RUNLATEX,
#endif
LFUN_BUILDPROG, // 10 LFUN_BUILDPROG, // 10
LFUN_TOCVIEW, LFUN_TOCVIEW,
LFUN_PREVIEW, LFUN_PREVIEW,
#ifndef NEW_EXPORT
LFUN_PREVIEWPS,
#endif
LFUN_CLOSEBUFFER, LFUN_CLOSEBUFFER,
LFUN_BUFFER_PRINT, // ARRae 20000313 LFUN_BUFFER_PRINT, // ARRae 20000313
LFUN_PRINTER_PARAMS_GET, // ARRae 20000313 LFUN_PRINTER_PARAMS_GET, // ARRae 20000313
@ -159,9 +151,6 @@ enum kb_action {
LFUN_LAYOUT_CHARACTER, LFUN_LAYOUT_CHARACTER,
LFUN_LAYOUT_PARAGRAPH, LFUN_LAYOUT_PARAGRAPH,
LFUN_LAYOUT_DOCUMENT, LFUN_LAYOUT_DOCUMENT,
LFUN_LAYOUT_PAPER,
LFUN_LAYOUT_TABLE,
LFUN_LAYOUT_QUOTES,
LFUN_LAYOUT_PREAMBLE, LFUN_LAYOUT_PREAMBLE,
LFUN_LAYOUT_SAVE_DEFAULT, LFUN_LAYOUT_SAVE_DEFAULT,
LFUN_DROP_LAYOUTS_CHOICE, // 140 LFUN_DROP_LAYOUTS_CHOICE, // 140
@ -197,9 +186,6 @@ enum kb_action {
LFUN_BACKSPACE_SKIP, // 170 LFUN_BACKSPACE_SKIP, // 170
LFUN_DELETE_SKIP, LFUN_DELETE_SKIP,
LFUN_MENUNEWTMPLT, // Asger 1997-02-02 LFUN_MENUNEWTMPLT, // Asger 1997-02-02
#ifndef NEW_EXPORT
LFUN_RUNDVIPS, // Asger 1997-02-02
#endif
LFUN_MENURELOAD, // Asger 1997-02-02 LFUN_MENURELOAD, // Asger 1997-02-02
LFUN_FAX, // Asger 1997-02-10 LFUN_FAX, // Asger 1997-02-10
LFUN_RECONFIGURE, // Asger 1997-02-14 LFUN_RECONFIGURE, // Asger 1997-02-14
@ -239,7 +225,6 @@ enum kb_action {
LFUN_LDOTS, // Asger 970929 LFUN_LDOTS, // Asger 970929
LFUN_END_OF_SENTENCE, // Asger 970929 LFUN_END_OF_SENTENCE, // Asger 970929
LFUN_RUNCHKTEX, // Asger 971030 LFUN_RUNCHKTEX, // Asger 971030
LFUN_BUFFERBULLETSSELECT, // ARRae 971018
LFUN_TOGGLECURSORFOLLOW, // ARRae 971202 LFUN_TOGGLECURSORFOLLOW, // ARRae 971202
LFUN_HTMLURL, // CFO-G 971121 LFUN_HTMLURL, // CFO-G 971121
LFUN_URL, // CFO-G 971121 LFUN_URL, // CFO-G 971121

View File

@ -275,7 +275,7 @@ bool Converter::Convert(Buffer * buffer, string const & from_file,
string to_format = GetExtension(to_file); string to_format = GetExtension(to_file);
if (from_format == to_format) if (from_format == to_format)
if (from_file != to_file) if (from_file != to_file)
return lyx::rename(from_file.c_str(), to_file.c_str()); return lyx::rename(from_file, to_file);
else else
return true; return true;
@ -408,15 +408,15 @@ bool Converter::Convert(Buffer * buffer, string const & from_file,
"$$BaseName", from_base); "$$BaseName", from_base);
string to = subst((*it).result_dir, string to = subst((*it).result_dir,
"$$BaseName", to_base); "$$BaseName", to_base);
return lyx::rename(from.c_str(), to.c_str()); return lyx::rename(from, to);
} }
} else if (outfile != to_file) } else if (outfile != to_file)
if ((*it).from == "tex" && if ((*it).from == "tex" &&
( (*it).to == "dvi" || (*it).to == "pdf") ) ( (*it).to == "dvi" || (*it).to == "pdf") )
return lyx::copy(outfile.c_str(), to_file.c_str()); return lyx::copy(outfile, to_file);
else else
return lyx::rename(outfile.c_str(), to_file.c_str()); return lyx::rename(outfile, to_file);
return true; return true;
} }

View File

@ -77,7 +77,7 @@ Counters::~Counters()
void Counters::newCounter(string const & newc) void Counters::newCounter(string const & newc)
{ {
// First check if newc already exist // 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 alrady exist give warning and return
if (cit != counterList.end()) { if (cit != counterList.end()) {
lyxerr << "The new counter already exist." << endl; 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) void Counters::newCounter(string const & newc, string const & oldc)
{ {
// First check if newc already exist // 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 already existant give warning and return
if (cit != counterList.end()) { if (cit != counterList.end()) {
lyxerr << "The new counter already exist." << endl; lyxerr << "The new counter already exist." << endl;

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.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_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
fl_end_form(); fl_end_form();
//fdui->form_credits->fdui = fdui; fdui->form_credits->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -43,7 +43,4 @@ public:
static static
string const BufferExtension(Buffer const * buffer); string const BufferExtension(Buffer const * buffer);
}; };
#define NEW_EXPORT 1
#endif #endif

View File

@ -60,7 +60,6 @@ using std::sort;
#ifdef BROKEN_HEADERS #ifdef BROKEN_HEADERS
extern "C" int gettimeofday(struct timeval *, struct timezone *); extern "C" int gettimeofday(struct timeval *, struct timezone *);
#define remove(a) unlink(a)
#endif #endif
#ifdef __GNUG__ #ifdef __GNUG__
@ -183,12 +182,12 @@ LyXFileDlg * LyXFileDlg::pCurrentDlg = 0;
void LyXFileDlg::Reread() void LyXFileDlg::Reread()
{ {
// Opens directory // Opens directory
DIR * pDirectory = opendir(pszDirectory.c_str()); DIR * pDirectory = ::opendir(pszDirectory.c_str());
if (!pDirectory) { if (!pDirectory) {
WriteFSAlert(_("Warning! Couldn't open directory."), WriteFSAlert(_("Warning! Couldn't open directory."),
pszDirectory); pszDirectory);
pszDirectory = GetCWD(); pszDirectory = GetCWD();
pDirectory = opendir(pszDirectory.c_str()); pDirectory = ::opendir(pszDirectory.c_str());
} }
// Clear the present namelist // Clear the present namelist

View File

@ -155,10 +155,10 @@ int lyxfont::width(char const * s, int n, LyXFont const & f)
int lyxfont::signedWidth(string const & s, LyXFont const & f) int lyxfont::signedWidth(string const & s, LyXFont const & f)
{ {
if (s.empty()) return 0; if (s.empty()) return 0;
if (s.c_str()[0] == '-') if (s[0] == '-')
return -width(s.c_str() + 1, s.length() - 1, f); return -width(s.substr(1, s.length() - 1), f);
else else
return width(s.c_str(), s.length(), f); return width(s, f);
} }

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.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); 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); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->ChsetErr = obj = fl_add_text(FL_NORMAL_TEXT, 210, 310, 170, 30, _("Charset not found!")); 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_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE); fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE+FL_EMBOSSED_STYLE); 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")); 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_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE); fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE+FL_EMBOSSED_STYLE); 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_set_object_lalign(obj, FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
fl_end_form(); fl_end_form();
//fdui->KeyMap->fdui = fdui; fdui->KeyMap->fdui = fdui;
return fdui; return fdui;
} }
@ -212,7 +212,7 @@ FD_Figure *create_form_Figure(void)
fl_set_object_callback(obj, GraphicsCB, 70); fl_set_object_callback(obj, GraphicsCB, 70);
fl_end_form(); fl_end_form();
//fdui->Figure->fdui = fdui; fdui->Figure->fdui = fdui;
return fdui; return fdui;
} }
@ -268,39 +268,7 @@ FD_FileDlg *create_form_FileDlg(void)
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
fl_end_form(); fl_end_form();
//fdui->FileDlg->fdui = fdui; 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;
return fdui; return fdui;
} }
@ -349,7 +317,7 @@ FD_form_search *create_form_form_search(void)
fl_set_object_callback(obj, SearchReplaceAllCB, 0); fl_set_object_callback(obj, SearchReplaceAllCB, 0);
fl_end_form(); fl_end_form();
//fdui->form_search->fdui = fdui; fdui->form_search->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -8,10 +8,6 @@
extern "C" void GraphicsCB(FL_OBJECT *, long); 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 SearchForwardCB(FL_OBJECT *, long);
extern "C" void SearchBackwardCB(FL_OBJECT *, long); extern "C" void SearchBackwardCB(FL_OBJECT *, long);
extern "C" void SearchReplaceCB(FL_OBJECT *, long); extern "C" void SearchReplaceCB(FL_OBJECT *, long);
@ -98,19 +94,6 @@ typedef struct {
} FD_FileDlg; } FD_FileDlg;
extern FD_FileDlg * create_form_FileDlg(void); 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 { typedef struct {
FL_FORM *form_search; FL_FORM *form_search;
void *vdata; void *vdata;

View File

@ -32,10 +32,6 @@
using std::endl; using std::endl;
extern LyXRC lyxrc; 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 #ifdef CXX_WORKING_NAMESPACES
namespace Liason namespace Liason
@ -53,9 +49,6 @@ PrinterParams getPrinterParams(Buffer * buffer)
bool printBuffer(Buffer * buffer, PrinterParams const & pp) bool printBuffer(Buffer * buffer, PrinterParams const & pp)
{ {
#ifndef NEW_EXPORT
bool result(false);
#endif
string command(lyxrc.print_command + ' '); string command(lyxrc.print_command + ' ');
if (pp.target == PrinterParams::PRINTER if (pp.target == PrinterParams::PRINTER
@ -112,7 +105,6 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp)
command += Converter::dvips_options(buffer) + ' '; command += Converter::dvips_options(buffer) + ' ';
#ifdef NEW_EXPORT
if (!Exporter::Export(buffer, "dvi", true)) if (!Exporter::Export(buffer, "dvi", true))
return false; return false;
@ -163,57 +155,6 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp)
break; break;
} }
return res == 0; 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) void setMinibuffer(LyXView * lv, char const * msg)

View File

@ -210,7 +210,7 @@ void FormDocument::build()
fl_end_form(); fl_end_form();
// "default" is not part of the languages array any more. // "default" is not part of the languages array any more.
combo_language->addto("default"); combo_language->addto("default");
for(Languages::const_iterator cit = languages.begin(); for(Languages::iterator cit = languages.begin();
cit != languages.end(); ++cit) { cit != languages.end(); ++cit) {
combo_language->addto((*cit).second.lang().c_str()); combo_language->addto((*cit).second.lang().c_str());
} }

View File

@ -23,7 +23,7 @@ struct FD_form_error;
/** This class provides an XForms implementation of the FormError Dialog. /** This class provides an XForms implementation of the FormError Dialog.
*/ */
class FormError : public FormBase, public noncopyable { class FormError : public FormBase {
public: public:
/// Constructor /// Constructor
FormError(LyXView *, Dialogs *); FormError(LyXView *, Dialogs *);

View File

@ -264,7 +264,7 @@ extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data)
// What are we supposed to do with that?? // What are we supposed to do with that??
int Toolbar::get_toolbar_func(string const & func) int Toolbar::get_toolbar_func(string const & func)
{ {
int action = lyxaction.LookupFunc(func.c_str()); int action = lyxaction.LookupFunc(func);
if (action == -1) { if (action == -1) {
if (func == "separator"){ if (func == "separator"){
action = TOOL_SEPARATOR; action = TOOL_SEPARATOR;

View File

@ -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> ### Modified by Allan Rae <rae@lyx.org>
### Rewritten by Angus Leeming. ### Rewritten by Angus Leeming.
### Only update files that really have changed. (Lgb 20000924))
SHELL = /bin/sh SHELL = /bin/sh
.SUFFIXES: .fd .c .SUFFIXES: .fd .c
@ -43,7 +44,9 @@ all:
test: clean $(OBJS) test: clean $(OBJS)
updatesrc: test updatesrc: test
mv *.C *.h .. for fil in *.C *.h ; do \
cmp -s $$fil ../$$fil || mv $$fil .. \
done
.fd.C: .fd.C:
${SHELL} ./fdfix.sh $< ${SHELL} ./fdfix.sh $<

View File

@ -52,7 +52,7 @@ GraphicsCache::~GraphicsCache()
GraphicsCacheItem * GraphicsCacheItem *
GraphicsCache::addFile(string const & filename) GraphicsCache::addFile(string const & filename)
{ {
CacheType::const_iterator it = cache.find(filename); CacheType::iterator it = cache.find(filename);
if (it != cache.end()) { if (it != cache.end()) {
return new GraphicsCacheItem( *((*it).second) ); return new GraphicsCacheItem( *((*it).second) );

View File

@ -13,8 +13,6 @@
#include <map> #include <map>
#include <unistd.h> // unlink
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
#ifdef __GNUG__ #ifdef __GNUG__
@ -150,7 +148,7 @@ GraphicsCacheItem_pimpl::loadXPMImage()
} }
// remove the xpm file now. // remove the xpm file now.
::unlink(xpmfile.c_str()); lyx::unlink(xpmfile);
// and remove the reference to the filename. // and remove the reference to the filename.
xpmfile = string(); xpmfile = string();
} }

View File

@ -161,7 +161,7 @@ void kill_gs(int pid, int sig)
if (lyxerr.debugging()) if (lyxerr.debugging())
lyxerr << "Killing gs " << pid << endl; lyxerr << "Killing gs " << pid << endl;
lyx::kill(pid, sig); 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 // now chdir into dir with .eps file, to be on the safe
// side // side
::chdir(OnlyPath(p->data->fname).c_str()); lyx::chdir(OnlyPath(p->data->fname));
// make temp file name // make temp file name
string tmpf = make_tmp(getpid()); string tmpf = make_tmp(getpid());
if (lyxerr.debugging()) { if (lyxerr.debugging()) {
@ -684,7 +684,7 @@ void runqueue()
lyxerr.debug() << "Cmd: " lyxerr.debug() << "Cmd: "
<< lyxrc.ps_command << lyxrc.ps_command
<< " -sDEVICE=x11 " << " -sDEVICE=x11 "
<< tmpf.c_str() << ' ' << tmpf << ' '
<< p->data->fname << endl; << p->data->fname << endl;
_exit(0); // no gs? _exit(0); // no gs?
} }
@ -832,7 +832,7 @@ void sigchldchecker(pid_t pid, int * status)
p->broken = false; p->broken = false;
} else { } else {
// remove temporary files // remove temporary files
unlink(make_tmp(p->gspid).c_str()); lyx::unlink(make_tmp(p->gspid));
p->gspid = -1; p->gspid = -1;
p->broken = true; p->broken = true;
} }
@ -1952,7 +1952,7 @@ void InsetFig::BrowseFile()
buf = MakeAbsPath(p, buf2); buf = MakeAbsPath(p, buf2);
buf = OnlyPath(buf); buf = OnlyPath(buf);
} else { } else {
buf = OnlyPath(owner->fileName().c_str()); buf = OnlyPath(owner->fileName());
} }
// Does user clipart directory exist? // Does user clipart directory exist?

View File

@ -349,7 +349,7 @@ void InsetBibtex::Edit(BufferView * bv, int, int, unsigned int)
bool InsetBibtex::addDatabase(string const & db) bool InsetBibtex::addDatabase(string const & db)
{ {
string contents(getContents()); string contents(getContents());
if (!contains(contents, db.c_str())) { if (!contains(contents, db)) {
if (!contents.empty()) if (!contents.empty())
contents += ","; contents += ",";
setContents(contents + db); setContents(contents + db);
@ -361,14 +361,14 @@ bool InsetBibtex::addDatabase(string const & db)
bool InsetBibtex::delDatabase(string const & db) bool InsetBibtex::delDatabase(string const & db)
{ {
if (contains(getContents(), db.c_str())) { if (contains(getContents(), db)) {
string bd = db; string bd = db;
int n = tokenPos(getContents(), ',', bd); int n = tokenPos(getContents(), ',', bd);
if (n > 0) { if (n > 0) {
// Weird code, would someone care to explain this?(Lgb) // Weird code, would someone care to explain this?(Lgb)
string tmp(", "); string tmp(", ");
tmp += bd; tmp += bd;
setContents(subst(getContents(), tmp.c_str(), ", ")); setContents(subst(getContents(), tmp, ", "));
} else if (n == 0) } else if (n == 0)
setContents(split(getContents(), bd, ',')); setContents(split(getContents(), bd, ','));
else else

View File

@ -100,7 +100,7 @@ void InsetCollapsable::Read(Buffer const * buf, LyXLex & lex)
int InsetCollapsable::ascent_collapsed(Painter & pain, LyXFont const &) const int InsetCollapsable::ascent_collapsed(Painter & pain, LyXFont const &) const
{ {
int width = 0, ascent = 0, descent = 0; 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); width, ascent, descent);
return ascent; 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 InsetCollapsable::descent_collapsed(Painter & pain, LyXFont const &) const
{ {
int width = 0, ascent = 0, descent = 0; 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); width, ascent, descent);
return 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 InsetCollapsable::width_collapsed(Painter & pain, LyXFont const &) const
{ {
int width, ascent, descent; 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); width, ascent, descent);
return width + (2*TEXT_TO_INSET_OFFSET); return width + (2*TEXT_TO_INSET_OFFSET);
} }
@ -156,7 +156,7 @@ void InsetCollapsable::draw_collapsed(Painter & pain, LyXFont const &,
{ {
int width = 0; int width = 0;
pain.buttonText(int(x) + TEXT_TO_INSET_OFFSET, 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; x += width + TEXT_TO_INSET_OFFSET;
} }

View File

@ -42,7 +42,7 @@ InsetExternal::InsetExternal()
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 = MakeAbsPath(p, buf2);
buf = OnlyPath(buf); buf = OnlyPath(buf);
} else { } else {
buf = OnlyPath(holder->view->buffer()->fileName().c_str()); buf = OnlyPath(holder->view->buffer()->fileName());
} }
fileDlg.SetButton(0, _("Document"), buf); fileDlg.SetButton(0, _("Document"), buf);
@ -484,14 +484,14 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
// Handle the $$Contents(filename) syntax // Handle the $$Contents(filename) syntax
if (contains(result, "$$Contents(\"")) { if (contains(result, "$$Contents(\"")) {
int pos = result.find("$$Contents(\""); int const pos = result.find("$$Contents(\"");
int end = result.find("\")", pos); int const end = result.find("\")", pos);
string file = result.substr(pos + 12, end - (pos + 12)); string const file = result.substr(pos + 12, end - (pos + 12));
string contents; string contents;
if (buffer) { if (buffer) {
// Make sure we are in the directory of the buffer // Make sure we are in the directory of the buffer
string buf = MakeAbsPath(buffer->fileName()); string const buf = MakeAbsPath(buffer->fileName());
string path = OnlyPath(buf); string const path = OnlyPath(buf);
Path p(path); Path p(path);
contents = GetFileContents(file); contents = GetFileContents(file);
} else { } else {
@ -514,7 +514,7 @@ string const InsetExternal::getCurrentTemplate() const
ExternalTemplate const InsetExternal::getTemplate(string const & name) const ExternalTemplate const InsetExternal::getTemplate(string const & name) const
{ {
ExternalTemplateManager::Templates::const_iterator i = ExternalTemplateManager::Templates::iterator i =
ExternalTemplateManager::get().getTemplates().find(name); ExternalTemplateManager::get().getTemplates().find(name);
// Make sure that the template exists in the map // Make sure that the template exists in the map
if (i == ExternalTemplateManager::get().getTemplates().end()) { if (i == ExternalTemplateManager::get().getTemplates().end()) {

View File

@ -90,9 +90,8 @@ InsetFloat::InsetFloat(string const & type)
font.setColor(LColor::footnote); font.setColor(LColor::footnote);
setLabelFont(font); setLabelFont(font);
setAutoCollapse(false); setAutoCollapse(false);
// setInsetName("Float");
floatType = type; floatType = type;
setInsetName(type.c_str()); setInsetName(type);
//floatPlacement = "H"; //floatPlacement = "H";
} }

View File

@ -104,7 +104,7 @@ void include_cb(FL_OBJECT *, long arg)
{ {
// Should browsing too be disabled in RO-mode? // Should browsing too be disabled in RO-mode?
LyXFileDlg fileDlg; LyXFileDlg fileDlg;
string mpath = OnlyPath(inset->getMasterFilename()); string const mpath = OnlyPath(inset->getMasterFilename());
string ext; string ext;
if (fl_get_button(form->flag2)) // Use Input Button if (fl_get_button(form->flag2)) // Use Input Button
@ -117,14 +117,15 @@ void include_cb(FL_OBJECT *, long arg)
fileDlg.SetButton(0, _("Documents"), lyxrc.document_path); fileDlg.SetButton(0, _("Documents"), lyxrc.document_path);
// Use by default the master's path // Use by default the master's path
string filename = fileDlg.Select(_("Select Child Document"), string const filename =
fileDlg.Select(_("Select Child Document"),
mpath, ext, mpath, ext,
inset->getContents()); inset->getContents());
XFlush(fl_get_display()); XFlush(fl_get_display());
// check selected filename // check selected filename
if (!filename.empty()) { if (!filename.empty()) {
string filename2 = MakeRelPath(filename, string const filename2 = MakeRelPath(filename,
mpath); mpath);
if (prefixIs(filename2, "..")) if (prefixIs(filename2, ".."))
fl_set_input(form->input, fl_set_input(form->input,
@ -347,22 +348,20 @@ bool InsetInclude::loadIfNeeded() const
// the readonly flag can/will be wrong, not anymore I think. // the readonly flag can/will be wrong, not anymore I think.
FileInfo finfo(getFileName()); FileInfo finfo(getFileName());
bool ro = !finfo.writable(); bool const ro = !finfo.writable();
return ( bufferlist.readFile(getFileName(), ro) != 0 ); return bufferlist.readFile(getFileName(), ro) != 0;
} }
int InsetInclude::Latex(Buffer const *, ostream & os, int InsetInclude::Latex(Buffer const *, ostream & os,
bool /*fragile*/, bool /*fs*/) const 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()); string incfile(getContents());
// Do nothing if no file name has been specified
if (incfile.empty())
return 0;
if (loadIfNeeded()) { if (loadIfNeeded()) {
Buffer * tmp = bufferlist.getBuffer(getFileName()); Buffer * tmp = bufferlist.getBuffer(getFileName());
@ -424,12 +423,12 @@ int InsetInclude::Latex(Buffer const *, ostream & os,
int InsetInclude::Linuxdoc(Buffer const *, ostream & os) const 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()); string incfile(getContents());
// Do nothing if no file name has been specified
if (incfile.empty())
return 0;
if (loadIfNeeded()) { if (loadIfNeeded()) {
Buffer * tmp = bufferlist.getBuffer(getFileName()); 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 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()); string incfile(getContents());
// Do nothing if no file name has been specified
if (incfile.empty())
return 0;
if (loadIfNeeded()) { if (loadIfNeeded()) {
Buffer * tmp = bufferlist.getBuffer(getFileName()); Buffer * tmp = bufferlist.getBuffer(getFileName());
@ -530,7 +529,6 @@ void InsetInclude::Validate(LaTeXFeatures & features) const
vector<string> const InsetInclude::getLabelList() const vector<string> const InsetInclude::getLabelList() const
{ {
vector<string> l; vector<string> l;
string parentname;
if (loadIfNeeded()) { if (loadIfNeeded()) {
Buffer * tmp = bufferlist.getBuffer(getFileName()); Buffer * tmp = bufferlist.getBuffer(getFileName());

View File

@ -276,12 +276,12 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
pain.fillRectangle( pain.fillRectangle(
nx + 1, nx + 1,
baseline - tabular->GetAscentOfRow(i) + 1, baseline - tabular->GetAscentOfRow(i) + 1,
cx - nx - 1, int(cx - nx - 1),
tabular->GetAscentOfRow(i) + tabular->GetAscentOfRow(i) +
tabular->GetDescentOfRow(i) - 1); tabular->GetDescentOfRow(i) - 1);
// clear behind the inset // clear behind the inset
pain.fillRectangle( pain.fillRectangle(
cx + the_locking_inset->width(bv,font) + 1, int(cx + the_locking_inset->width(bv,font) + 1),
baseline - tabular->GetAscentOfRow(i) + 1, baseline - tabular->GetAscentOfRow(i) + 1,
tabular->GetWidthOfColumn(cell) - tabular->GetWidthOfColumn(cell) -
tabular->GetBeginningOfTextInCell(cell) - tabular->GetBeginningOfTextInCell(cell) -
@ -443,7 +443,7 @@ void InsetTabular::InsetUnlock(BufferView * bv)
locked = false; locked = false;
if (scroll() || hasSelection()) { if (scroll() || hasSelection()) {
if (scroll()) { if (scroll()) {
scroll(bv, (float)0.0); scroll(bv, 0.0F);
} else { } else {
sel_pos_start = sel_pos_end = 0; sel_pos_start = sel_pos_end = 0;
sel_cell_start = sel_cell_end = 0; sel_cell_start = sel_cell_end = 0;
@ -457,6 +457,7 @@ void InsetTabular::UpdateLocal(BufferView * bv, UpdateCodes what,
bool mark_dirty) const bool mark_dirty) const
{ {
need_update = what; need_update = what;
// Dirty Cast! (Lgb)
bv->updateInset(const_cast<InsetTabular *>(this), mark_dirty); bv->updateInset(const_cast<InsetTabular *>(this), mark_dirty);
if (locked && (what != NONE)) if (locked && (what != NONE))
resetPos(bv); resetPos(bv);
@ -509,11 +510,11 @@ bool InsetTabular::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
return true; return true;
} }
if (the_locking_inset->UnlockInsetInInset(bv, inset, lr)) { if (the_locking_inset->UnlockInsetInInset(bv, inset, lr)) {
if ((inset->LyxCode() == TABULAR_CODE) && if (inset->LyxCode() == TABULAR_CODE &&
!the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) !the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE))
{ {
dialogs_ = bv->owner()->getDialogs(); dialogs_ = bv->owner()->getDialogs();
dialogs_->updateTabular(const_cast<InsetTabular *>(this)); dialogs_->updateTabular(this);
oldcell = actcell; oldcell = actcell;
} }
return true; return true;
@ -574,8 +575,8 @@ void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button)
} }
no_selection = false; no_selection = false;
int ocell = actcell; int const ocell = actcell;
int orow = actrow; int const orow = actrow;
HideInsetCursor(bv); HideInsetCursor(bv);
setPos(bv, x, y); 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_pos_start = sel_pos_end = cursor.pos();
sel_cell_start = sel_cell_end = actcell; 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) { 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; return;
} else if (the_locking_inset) { } else if (the_locking_inset) {
the_locking_inset->InsetUnlock(bv); the_locking_inset->InsetUnlock(bv);
@ -635,8 +637,8 @@ void InsetTabular::InsetMotionNotify(BufferView * bv, int x, int y, int button)
} }
if (!no_selection) { if (!no_selection) {
HideInsetCursor(bv); HideInsetCursor(bv);
int old_pos = sel_pos_end; int const old_pos = sel_pos_end;
int old_cell = actcell; int const old_cell = actcell;
setPos(bv, x, y); setPos(bv, x, y);
sel_pos_end = cursor.pos(); sel_pos_end = cursor.pos();
@ -752,7 +754,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
break; break;
case LFUN_DOWNSEL: case LFUN_DOWNSEL:
{ {
int ocell = actcell; int const ocell = actcell;
moveDown(bv); moveDown(bv);
sel_pos_end = cursor.pos(); sel_pos_end = cursor.pos();
if ((ocell == sel_cell_end) || if ((ocell == sel_cell_end) ||
@ -772,7 +774,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
break; break;
case LFUN_UPSEL: case LFUN_UPSEL:
{ {
int ocell = actcell; int const ocell = actcell;
moveUp(bv); moveUp(bv);
sel_pos_end = cursor.pos(); sel_pos_end = cursor.pos();
if ((ocell == sel_cell_end) || if ((ocell == sel_cell_end) ||
@ -813,12 +815,22 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action,
if (hs) if (hs)
UpdateLocal(bv, SELECTION, false); UpdateLocal(bv, SELECTION, false);
break; break;
#if 0
case LFUN_LAYOUT_TABLE: case LFUN_LAYOUT_TABLE:
{ {
dialogs_ = bv->owner()->getDialogs(); dialogs_ = bv->owner()->getDialogs();
dialogs_->showTabular(this); dialogs_->showTabular(this);
} }
break; 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: case LFUN_TABULAR_FEATURE:
if (!TabularFeatures(bv, arg)) if (!TabularFeatures(bv, arg))
result = UNDISPATCHED; result = UNDISPATCHED;
@ -954,8 +966,8 @@ void InsetTabular::ToggleInsetCursor(BufferView * bv)
LyXFont font; // = the_locking_inset->GetFont(par, cursor.pos); LyXFont font; // = the_locking_inset->GetFont(par, cursor.pos);
int asc = lyxfont::maxAscent(font); int const asc = lyxfont::maxAscent(font);
int desc = lyxfont::maxDescent(font); int const desc = lyxfont::maxDescent(font);
if (cursor_visible) if (cursor_visible)
bv->hideLockedInsetCursor(); bv->hideLockedInsetCursor();
@ -970,8 +982,8 @@ void InsetTabular::ShowInsetCursor(BufferView * bv)
if (!cursor_visible) { if (!cursor_visible) {
LyXFont font; // = GetFont(par, cursor.pos); LyXFont font; // = GetFont(par, cursor.pos);
int asc = lyxfont::maxAscent(font); int const asc = lyxfont::maxAscent(font);
int desc = lyxfont::maxDescent(font); int const desc = lyxfont::maxDescent(font);
bv->fitLockedInsetCursor(cursor.x(), cursor.y(), asc, desc); bv->fitLockedInsetCursor(cursor.x(), cursor.y(), asc, desc);
bv->showLockedInsetCursor(cursor.x(), cursor.y(), asc, desc); bv->showLockedInsetCursor(cursor.x(), cursor.y(), asc, desc);
cursor_visible = true; cursor_visible = true;
@ -1029,9 +1041,9 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
int InsetTabular::getCellXPos(int cell) 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); int lx = tabular->GetWidthOfColumn(cell);
for(; (c < cell); ++c) { for(; (c < cell); ++c) {
@ -1058,7 +1070,7 @@ void InsetTabular::resetPos(BufferView * bv) const
++actrow; ++actrow;
} }
} }
static int offset = ADD_TO_TABULAR_WIDTH + 2; static int const offset = ADD_TO_TABULAR_WIDTH + 2;
cursor.x(getCellXPos(actcell) + offset); cursor.x(getCellXPos(actcell) + offset);
if (((cursor.x() - offset) > 20) && if (((cursor.x() - offset) > 20) &&
((cursor.x()-offset+tabular->GetWidthOfColumn(actcell)) > ((cursor.x()-offset+tabular->GetWidthOfColumn(actcell)) >
@ -1123,7 +1135,7 @@ UpdatableInset::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock)
UpdatableInset::RESULT InsetTabular::moveUp(BufferView * bv) UpdatableInset::RESULT InsetTabular::moveUp(BufferView * bv)
{ {
int ocell = actcell; int const ocell = actcell;
actcell = tabular->GetCellAbove(actcell); actcell = tabular->GetCellAbove(actcell);
if (actcell == ocell) // we moved out of the inset if (actcell == ocell) // we moved out of the inset
return FINISHED; return FINISHED;
@ -1134,7 +1146,7 @@ UpdatableInset::RESULT InsetTabular::moveUp(BufferView * bv)
UpdatableInset::RESULT InsetTabular::moveDown(BufferView * bv) UpdatableInset::RESULT InsetTabular::moveDown(BufferView * bv)
{ {
int ocell = actcell; int const ocell = actcell;
actcell = tabular->GetCellBelow(actcell); actcell = tabular->GetCellBelow(actcell);
if (actcell == ocell) // we moved out of the inset if (actcell == ocell) // we moved out of the inset
return FINISHED; 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; int action = LyXTabular::LAST_ACTION;
string val;
int i;
for(i=0; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) { int i = 0;
if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(), for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
tabularFeatures[i].feature.length())) { 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; action = tabularFeatures[i].action;
break; break;
} }
@ -1198,13 +1212,15 @@ bool InsetTabular::TabularFeatures(BufferView * bv, string what)
if (action == LyXTabular::LAST_ACTION) if (action == LyXTabular::LAST_ACTION)
return false; return false;
val = frontStrip(what.substr(tabularFeatures[i].feature.length())); string const val =
frontStrip(what.substr(tabularFeatures[i].feature.length()));
TabularFeatures(bv, action, val); TabularFeatures(bv, action, val);
return true; return true;
} }
void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value) void InsetTabular::TabularFeatures(BufferView * bv, int feature,
string const & value)
{ {
int int
i, j, i, j,
@ -1246,7 +1262,6 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
break; break;
} }
if (hasSelection()) { if (hasSelection()) {
int tmp;
sel_col_start = tabular->column_of_cell(sel_cell_start); sel_col_start = tabular->column_of_cell(sel_cell_start);
sel_col_end = tabular->column_of_cell(sel_cell_end); sel_col_end = tabular->column_of_cell(sel_cell_end);
if (sel_col_start > sel_col_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_start = tabular->row_of_cell(sel_cell_start);
sel_row_end = tabular->row_of_cell(sel_cell_end); sel_row_end = tabular->row_of_cell(sel_cell_end);
if (sel_row_start > sel_row_end) { if (sel_row_start > sel_row_end) {
tmp = sel_row_start; //int tmp = sel_row_start;
sel_row_start = sel_row_end; //sel_row_start = sel_row_end;
sel_row_end = tmp; //sel_row_end = tmp;
swap(sel_row_start, sel_row_end);
} }
} else { } else {
sel_col_start = sel_col_end = tabular->column_of_cell(actcell); 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) { switch (feature) {
case LyXTabular::SET_PWIDTH: case LyXTabular::SET_PWIDTH:
{ {
bool update = (tabular->GetColumnPWidth(actcell) != value); bool const update = (tabular->GetColumnPWidth(actcell) != value);
tabular->SetColumnPWidth(actcell,value); tabular->SetColumnPWidth(actcell,value);
if (update) { if (update) {
for (int i=0; i < tabular->rows(); ++i) { for (int i=0; i < tabular->rows(); ++i) {
@ -1297,7 +1313,7 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
break; break;
case LyXTabular::SET_MPWIDTH: case LyXTabular::SET_MPWIDTH:
{ {
bool update = (tabular->GetPWidth(actcell) != value); bool const update = (tabular->GetPWidth(actcell) != value);
tabular->SetMColumnPWidth(actcell,value); tabular->SetMColumnPWidth(actcell,value);
if (update) { if (update) {
for (int i=0; i < tabular->rows(); ++i) { 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 // we have a selection so this means we just add all this
// cells to form a multicolumn cell // cells to form a multicolumn cell
int int s_start;
s_start, s_end; int s_end;
if (sel_cell_start > sel_cell_end) { if (sel_cell_start > sel_cell_end) {
s_start = sel_cell_end; s_start = sel_cell_end;
@ -1486,8 +1502,7 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value)
break; break;
case LyXTabular::SET_USEBOX: case LyXTabular::SET_USEBOX:
{ {
LyXTabular::BoxType val = static_cast<LyXTabular::BoxType> LyXTabular::BoxType val = LyXTabular::BoxType(strToInt(value));
(strToInt(value));
if (val == tabular->GetUsebox(actcell)) if (val == tabular->GetUsebox(actcell))
val = LyXTabular::BOX_NONE; val = LyXTabular::BOX_NONE;
for(i = sel_row_start; i <= sel_row_end; ++i) for(i = sel_row_start; i <= sel_row_end; ++i)
@ -1562,7 +1577,7 @@ bool InsetTabular::InsetHit(BufferView * bv, int x, int ) const
// in pixels if we have a pwidth for this cell. // in pixels if we have a pwidth for this cell.
int InsetTabular::GetMaxWidthOfCell(Painter &, int cell) const int InsetTabular::GetMaxWidthOfCell(Painter &, int cell) const
{ {
string s = tabular->GetPWidth(cell); string const s = tabular->GetPWidth(cell);
if (s.empty()) if (s.empty())
return -1; return -1;
@ -1573,9 +1588,9 @@ int InsetTabular::GetMaxWidthOfCell(Painter &, int cell) const
int InsetTabular::getMaxWidth(Painter & pain, int InsetTabular::getMaxWidth(Painter & pain,
UpdatableInset const * inset) const UpdatableInset const * inset) const
{ {
int cell; int const n = tabular->GetNumberOfCells();
int n = tabular->GetNumberOfCells(); int cell = 0;
for(cell=0; cell < n; ++cell) { for(; cell < n; ++cell) {
if (tabular->GetCellInset(cell) == inset) if (tabular->GetCellInset(cell) == inset)
break; break;
} }
@ -1594,6 +1609,7 @@ void InsetTabular::resizeLyXText(BufferView *) const
need_update = FULL; need_update = FULL;
} }
LyXText * InsetTabular::getLyXText(BufferView * bv) const LyXText * InsetTabular::getLyXText(BufferView * bv) const
{ {
if (the_locking_inset) if (the_locking_inset)
@ -1623,16 +1639,17 @@ void InsetTabular::OpenLayoutDialog(BufferView * bv) const
// 2 ... toggled on // 2 ... toggled on
// 3 ... toggled off // 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; int action = LyXTabular::LAST_ACTION;
string argument;
int i;
LyXFunc::func_status status = LyXFunc::OK; LyXFunc::func_status status = LyXFunc::OK;
for(i=0; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) { int i = 0;
if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(), for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
tabularFeatures[i].feature.length())) { 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; action = tabularFeatures[i].action;
break; break;
} }
@ -1640,20 +1657,20 @@ LyXFunc::func_status InsetTabular::getStatus(string what) const
if (action == LyXTabular::LAST_ACTION) if (action == LyXTabular::LAST_ACTION)
return LyXFunc::Unknown; 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 sel_row_start, sel_row_end;
int dummy; int dummy;
bool flag = true; bool flag = true;
if (hasSelection()) { if (hasSelection()) {
int tmp;
sel_row_start = tabular->row_of_cell(sel_cell_start); sel_row_start = tabular->row_of_cell(sel_cell_start);
sel_row_end = tabular->row_of_cell(sel_cell_end); sel_row_end = tabular->row_of_cell(sel_cell_end);
if (sel_row_start > sel_row_end) { if (sel_row_start > sel_row_end) {
tmp = sel_row_start; //int tmp = sel_row_start;
sel_row_start = sel_row_end; //sel_row_start = sel_row_end;
sel_row_end = tmp; //sel_row_end = tmp;
swap(sel_row_start, sel_row_end);
} }
} else { } else {
sel_row_start = sel_row_end = tabular->row_of_cell(actcell); sel_row_start = sel_row_end = tabular->row_of_cell(actcell);
@ -1864,19 +1881,20 @@ bool InsetTabular::copySelection()
sel_row_start = tabular->row_of_cell(sel_cell_start); sel_row_start = tabular->row_of_cell(sel_cell_start);
sel_row_end = tabular->row_of_cell(sel_cell_end); sel_row_end = tabular->row_of_cell(sel_cell_end);
if (sel_row_start > sel_row_end) { if (sel_row_start > sel_row_end) {
int tmp; //int tmp tmp = sel_row_start;
tmp = sel_row_start; //sel_row_start = sel_row_end;
sel_row_start = sel_row_end; //sel_row_end = tmp;
sel_row_end = tmp; swap(sel_row_start, sel_row_end);
} }
int rows = sel_row_end - sel_row_start + 1; int rows = sel_row_end - sel_row_start + 1;
paste_tabular = new LyXTabular(this, rows, columns); paste_tabular = new LyXTabular(this, rows, columns);
if (sel_cell_start > sel_cell_end) { if (sel_cell_start > sel_cell_end) {
int tmp = sel_cell_start; //int tmp = sel_cell_start;
sel_cell_start = sel_cell_end; //sel_cell_start = sel_cell_end;
sel_cell_end = tmp; //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) < while(paste_tabular->row_of_cell(j) <
@ -1933,19 +1951,19 @@ bool InsetTabular::cutSelection()
sel_row_start = tabular->row_of_cell(sel_cell_start); sel_row_start = tabular->row_of_cell(sel_cell_start);
sel_row_end = tabular->row_of_cell(sel_cell_end); sel_row_end = tabular->row_of_cell(sel_cell_end);
if (sel_row_start > sel_row_end) { if (sel_row_start > sel_row_end) {
int tmp; //int tmp = sel_row_start;
tmp = sel_row_start; //sel_row_start = sel_row_end;
sel_row_start = sel_row_end; //sel_row_end = tmp;
sel_row_end = tmp; swap(sel_row_start, sel_row_end);
} }
if (sel_cell_start > sel_cell_end) { if (sel_cell_start > sel_cell_end) {
int tmp = sel_cell_start; //int tmp = sel_cell_start;
sel_cell_start = sel_cell_end; //sel_cell_start = sel_cell_end;
sel_cell_end = tmp; //sel_cell_end = tmp;
swap(sel_cell_start, sel_cell_end);
} }
int i, j; for(int i = sel_row_start; i <= sel_row_end; ++i) {
for(i=sel_row_start; i <= sel_row_end; ++i) { for(int j = sel_col_start; j <= sel_col_end; ++j) {
for(j=sel_col_start; j <= sel_col_end; ++j) {
tabular->GetCellInset(tabular->GetCellNumber(i, j))->clear(); tabular->GetCellInset(tabular->GetCellNumber(i, j))->clear();
} }
} }

View File

@ -149,11 +149,12 @@ public:
/// ///
void ToggleInsetCursor(BufferView *); 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); void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
/// ///
@ -162,9 +163,12 @@ public:
Buffer * BufferOwner() const { return buffer; } Buffer * BufferOwner() const { return buffer; }
/// ///
LyXText * getLyXText(BufferView *) const; LyXText * getLyXText(BufferView *) const;
///
void resizeLyXText(BufferView *) const; void resizeLyXText(BufferView *) const;
///
void OpenLayoutDialog(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 // Public structures and variables

View File

@ -107,11 +107,18 @@ public:
}; };
/// ///
enum { TEXT_TO_INSET_OFFSET = 2 }; enum {
///
TEXT_TO_INSET_OFFSET = 2
};
///
enum EDITABLE { enum EDITABLE {
///
NOT_EDITABLE = 0, NOT_EDITABLE = 0,
///
IS_EDITABLE, IS_EDITABLE,
///
HIGHLY_EDITABLE HIGHLY_EDITABLE
}; };
@ -198,24 +205,27 @@ public:
/// ///
virtual bool InsertInsetAllowed(Inset *) const { return false; } 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 x() const { return top_x; }
/// ///
int y() const { return top_baseline; } 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 LyXText * getLyXText(BufferView *) const;
///
virtual void deleteLyXText(BufferView *, bool = true) const {} virtual void deleteLyXText(BufferView *, bool = true) const {}
///
virtual void resizeLyXText(BufferView *) const {} virtual void resizeLyXText(BufferView *) const {}
// returns the actuall scroll-value /// returns the actuall scroll-value
int scroll() const { return scx; } int scroll() const { return scx; }
protected: protected:

View File

@ -100,7 +100,7 @@ int kb_sequence::parse(string const & s)
{ {
if(s.empty()) return 1; if(s.empty()) return 1;
int i = 0; string::size_type i = 0;
unsigned int mod = 0, nmod = 0; unsigned int mod = 0, nmod = 0;
while (i < s.length()) { while (i < s.length()) {
if(s[i] && (s[i]) <= ' ') ++i; if(s[i] && (s[i]) <= ' ') ++i;
@ -142,7 +142,7 @@ int kb_sequence::parse(string const & s)
} }
} else { } else {
string tbuf; string tbuf;
int j = i; string::size_type j = i;
for(; j < s.length() && s[j] > ' '; ++j) for(; j < s.length() && s[j] > ' '; ++j)
tbuf += s[j]; // (!!!check bounds :-) tbuf += s[j]; // (!!!check bounds :-)

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h" #include "gettext.h"
@ -9,188 +9,6 @@
#include <cstdlib> #include <cstdlib>
#include "layout_forms.h" #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) FD_form_character *create_form_form_character(void)
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
@ -266,113 +84,7 @@ FD_form_character *create_form_form_character(void)
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fl_end_form(); fl_end_form();
//fdui->form_character->fdui = fdui; 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;
return 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_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
fl_end_form(); fl_end_form();
//fdui->form_preamble->fdui = fdui; fdui->form_preamble->fdui = fdui;
return 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

View File

@ -1,123 +1,21 @@
/** Header file generated with fdesign **/ /** Header file generated with fdesign **/
#ifndef FD_form_document_h_ #ifndef FD_form_character_h_
#define FD_form_document_h_ #define FD_form_character_h_
extern "C" {
/** Callbacks, globals and object handlers **/ /** 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 CharacterApplyCB(FL_OBJECT *, long);
extern "C" void CharacterCloseCB(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 PreambleOKCB(FL_OBJECT *, long);
extern "C" void PreambleApplyCB(FL_OBJECT *, long); extern "C" void PreambleApplyCB(FL_OBJECT *, long);
extern "C" void PreambleCancelCB(FL_OBJECT *, long); extern "C" void PreambleCancelCB(FL_OBJECT *, long);
extern "C" void QuotesOKCB(FL_OBJECT *, long); /* Some extra funcs */
extern "C" void QuotesApplyCB(FL_OBJECT *, long);
extern "C" void QuotesCancelCB(FL_OBJECT *, long);
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 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 ****/ /**** 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 { typedef struct {
FL_FORM *form_character; FL_FORM *form_character;
void *vdata; void *vdata;
@ -136,35 +34,6 @@ typedef struct {
} FD_form_character; } FD_form_character;
extern FD_form_character * create_form_form_character(void); 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 { typedef struct {
FL_FORM *form_preamble; FL_FORM *form_preamble;
void *vdata; void *vdata;
@ -177,118 +46,5 @@ typedef struct {
} FD_form_preamble; } FD_form_preamble;
extern FD_form_preamble * create_form_form_preamble(void); 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); #endif /* FD_form_character_h_ */
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_ */

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h" #include "gettext.h"
@ -28,7 +28,7 @@ FD_LaTeXLog *create_form_LaTeXLog(void)
fl_set_object_callback(obj, LatexLogUpdate, 0); fl_set_object_callback(obj, LatexLogUpdate, 0);
fl_end_form(); fl_end_form();
//fdui->LaTeXLog->fdui = fdui; fdui->LaTeXLog->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h" #include "gettext.h"
@ -21,7 +21,7 @@ FD_form_title *create_form_form_title(void)
fl_set_object_callback(obj, TimerCB, 0); fl_set_object_callback(obj, TimerCB, 0);
fl_end_form(); fl_end_form();
//fdui->form_title->fdui = fdui; fdui->form_title->fdui = fdui;
return fdui; return fdui;
} }
@ -59,7 +59,7 @@ FD_form_figure *create_form_form_figure(void)
fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form(); fl_end_form();
//fdui->form_figure->fdui = fdui; fdui->form_figure->fdui = fdui;
return 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_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
fl_end_form(); fl_end_form();
//fdui->form_external->fdui = fdui; fdui->form_external->fdui = fdui;
return fdui; return fdui;
} }

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
#define LYX_CB_H #define LYX_CB_H
#include "LString.h" #include "LString.h"
#include "lyxfont.h"
class BufferParams; class BufferParams;

View File

@ -44,16 +44,8 @@
using std::endl; using std::endl;
FD_form_title * fd_form_title; 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_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_preamble * fd_form_preamble;
FD_form_table * fd_form_table;
FD_form_sendto * fd_form_sendto; FD_form_sendto * fd_form_sendto;
FD_form_figure * fd_form_figure; FD_form_figure * fd_form_figure;
FD_LaTeXLog * fd_latex_log; // from log_form.h FD_LaTeXLog * fd_latex_log; // from log_form.h
@ -302,31 +294,6 @@ void LyXGUI::create_forms()
fl_end_form(); 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 // the character form
fd_form_character = create_form_form_character(); fd_form_character = create_form_form_character();
fl_set_form_atclose(fd_form_character->form_character, fl_set_form_atclose(fd_form_character->form_character,
@ -362,112 +329,13 @@ void LyXGUI::create_forms()
// build up the combox entries // build up the combox entries
combo_language2->addto(_("No change")); combo_language2->addto(_("No change"));
combo_language2->addto(_("Reset")); combo_language2->addto(_("Reset"));
for(Languages::const_iterator cit = languages.begin(); for(Languages::iterator cit = languages.begin();
cit != languages.end(); ++cit) { cit != languages.end(); ++cit) {
if ((*cit).second.lang() != "default") if ((*cit).second.lang() != "default")
combo_language2->addto((*cit).second.lang().c_str()); combo_language2->addto((*cit).second.lang().c_str());
} }
combo_language2->select_text(_("No change")); 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 // the preamble form
fd_form_preamble = create_form_form_preamble(); fd_form_preamble = create_form_form_preamble();
fl_set_form_atclose(fd_form_preamble->form_preamble, fl_set_form_atclose(fd_form_preamble->form_preamble,

View File

@ -20,7 +20,6 @@
#include "BufferView.h" #include "BufferView.h"
#include "bibforms.h" #include "bibforms.h"
#include "buffer.h" #include "buffer.h"
#include "bullet_forms.h"
#include "form1.h" #include "form1.h"
#include "gettext.h" #include "gettext.h"
#include "include_form.h" #include "include_form.h"
@ -42,21 +41,12 @@ using std::make_pair;
extern BufferView * current_view; 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_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_preamble * fd_form_preamble;
extern FD_form_table * fd_form_table;
extern FD_form_sendto * fd_form_sendto; extern FD_form_sendto * fd_form_sendto;
extern FD_form_figure * fd_form_figure; extern FD_form_figure * fd_form_figure;
extern FD_form_paragraph_extra * fd_form_paragraph_extra;
extern FD_LaTeXLog * fd_latex_log; extern FD_LaTeXLog * fd_latex_log;
extern FD_form_spell_check * fd_form_spell_check; extern FD_form_spell_check * fd_form_spell_check;
extern FD_form_bullet * fd_form_bullet;
extern FD_panel * fd_panel; extern FD_panel * fd_panel;
extern FD_delim * fd_delim; extern FD_delim * fd_delim;
extern FD_deco * fd_deco; extern FD_deco * fd_deco;
@ -91,31 +81,9 @@ void CloseAllBufferRelatedDialogs()
// have been created otherwise hiding one could cause a crash // have been created otherwise hiding one could cause a crash
// need the visible check otherwise XForms prints a warning // need the visible check otherwise XForms prints a warning
// if hiding an invisible form // 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) { if (fd_form_character->form_character->visible) {
fl_hide_form(fd_form_character->form_character); 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) { if (fd_form_preamble->form_preamble->visible) {
fl_hide_form(fd_form_preamble->form_preamble); 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. // Again the Signal/Slot mechanism is tailor made for this task.
void updateAllVisibleBufferRelatedDialogs() 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) { if (fd_form_preamble->form_preamble->visible) {
UpdateLayoutPreamble(); 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) { if (fd_latex_log->LaTeXLog->visible) {
LatexLogUpdate(0,0); LatexLogUpdate(0,0);
} }

View File

@ -38,10 +38,6 @@
#include "MenuBackend.h" #include "MenuBackend.h"
#include "ToolbarDefaults.h" #include "ToolbarDefaults.h"
#include "lyxlex.h" #include "lyxlex.h"
#if 1
// only to get access to NEW_EXPORT
#include "exporter.h"
#endif
using std::endl; using std::endl;
@ -141,7 +137,8 @@ LyX::LyX(int * argc, char * argv[])
// Execute batch commands if available // Execute batch commands if available
if (!batch_command.empty()) { 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 // no buffer loaded, create one
if (!last_loaded) if (!last_loaded)
@ -568,7 +565,7 @@ void LyX::queryUserLyXDir(bool explicit_userdir)
// Run configure in user lyx directory // Run configure in user lyx directory
Path p(user_lyxdir); Path p(user_lyxdir);
system(AddName(system_lyxdir, "configure").c_str()); ::system(AddName(system_lyxdir, "configure").c_str());
lyxerr << "LyX: " << _("Done!") << endl; lyxerr << "LyX: " << _("Done!") << endl;
} }
@ -744,25 +741,7 @@ bool LyX::easyParse(int * argc, char * argv[])
if (i + 1 < *argc) { if (i + 1 < *argc) {
string type(argv[i+1]); string type(argv[i+1]);
removeargs = 2; removeargs = 2;
#ifdef NEW_EXPORT
batch_command = "buffer-export " + type; 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 } else
lyxerr << _("Missing file type [eg latex, " lyxerr << _("Missing file type [eg latex, "
"ps...] after ") "ps...] after ")

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h" #include "gettext.h"
@ -74,7 +74,7 @@ FD_xsendfax *create_form_xsendfax(void)
fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form(); fl_end_form();
//fdui->xsendfax->fdui = fdui; fdui->xsendfax->fdui = fdui;
return fdui; return fdui;
} }
@ -92,7 +92,7 @@ FD_phonebook *create_form_phonebook(void)
fl_set_object_callback(obj, cb_select_phoneno, 0); fl_set_object_callback(obj, cb_select_phoneno, 0);
fl_end_form(); fl_end_form();
//fdui->phonebook->fdui = fdui; fdui->phonebook->fdui = fdui;
return fdui; return fdui;
} }
@ -111,7 +111,7 @@ FD_logfile *create_form_logfile(void)
fl_set_object_callback(obj, FaxLogfileCloseCB, 0); fl_set_object_callback(obj, FaxLogfileCloseCB, 0);
fl_end_form(); fl_end_form();
//fdui->logfile->fdui = fdui; fdui->logfile->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -127,7 +127,7 @@ bool button_send(string const & fname, string const & sendcmd)
lyxerr << "CMD: " << cmd << endl; lyxerr << "CMD: " << cmd << endl;
Systemcalls one(Systemcalls::System, cmd); Systemcalls one(Systemcalls::System, cmd);
show_logfile(logfile, false); show_logfile(logfile, false);
remove(logfile.c_str()); lyx::unlink(logfile);
return true; return true;
} }
@ -246,7 +246,7 @@ void cb_delete_phoneno(FL_OBJECT *, long )
void cb_save_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) { if (!fp) {
WriteAlert(_("Error!"), _("Cannot open phone book: "), phone_book); WriteAlert(_("Error!"), _("Cannot open phone book: "), phone_book);
return; return;

View File

@ -136,9 +136,9 @@ void LyXFindReplace::SearchReplaceCB()
// clear the selection (if there is any) // clear the selection (if there is any)
bv->toggleSelection(false); bv->toggleSelection(false);
bv->text-> bv->text->
ReplaceSelectionWithString(bv, replacestring.c_str()); ReplaceSelectionWithString(bv, replacestring);
bv->text-> bv->text->
SetSelectionOverString(bv, replacestring.c_str()); SetSelectionOverString(bv, replacestring);
bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
} }
@ -179,9 +179,9 @@ void LyXFindReplace::SearchReplaceAllCB()
bv->update(BufferView::SELECT|BufferView::FITCUR); bv->update(BufferView::SELECT|BufferView::FITCUR);
bv->toggleSelection(false); bv->toggleSelection(false);
bv->text-> bv->text->
ReplaceSelectionWithString(bv, replacestring.c_str()); ReplaceSelectionWithString(bv, replacestring);
bv->text-> bv->text->
SetSelectionOverString(bv, replacestring.c_str()); SetSelectionOverString(bv, replacestring);
bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
++replace_count; ++replace_count;
} }

View File

@ -107,16 +107,10 @@ extern bool MenuWriteAs(Buffer *);
extern int MenuRunLaTeX(Buffer *); extern int MenuRunLaTeX(Buffer *);
extern int MenuBuildProg(Buffer *); extern int MenuBuildProg(Buffer *);
extern int MenuRunChktex(Buffer *); extern int MenuRunChktex(Buffer *);
#ifndef NEW_EXPORT
extern bool CreatePostscript(Buffer *, bool);
#endif
extern void MenuPrint(Buffer *); extern void MenuPrint(Buffer *);
extern void MenuSendto(); extern void MenuSendto();
extern void QuitLyX(); extern void QuitLyX();
extern void MenuFax(Buffer *); extern void MenuFax(Buffer *);
#ifndef NEW_EXPORT
extern void MenuExport(Buffer *, string const &);
#endif
extern void show_symbols_form(LyXFunc *); extern void show_symbols_form(LyXFunc *);
extern LyXAction lyxaction; extern LyXAction lyxaction;
@ -124,22 +118,11 @@ extern LyXAction lyxaction;
extern tex_accent_struct get_accent(kb_action action); extern tex_accent_struct get_accent(kb_action action);
extern void AutoSave(BufferView *); extern void AutoSave(BufferView *);
#ifndef NEW_EXPORT
extern bool PreviewDVI(Buffer *);
extern bool PreviewPostscript(Buffer *);
#endif
extern void MenuInsertLabel(string const &); extern void MenuInsertLabel(string const &);
extern void MenuLayoutCharacter(); extern void MenuLayoutCharacter();
extern void MenuLayoutParagraph(); 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 MenuLayoutPreamble();
extern void MenuLayoutSave(); extern void MenuLayoutSave();
extern void bulletForm();
extern Buffer * NewLyxFile(string const &); extern Buffer * NewLyxFile(string const &);
extern void LoadLyXFile(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"; static bool noLaTeX = lyxrc.latex_command == "none";
bool disable = false; bool disable = false;
switch (action) { 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: case LFUN_MENUPRINT:
disable = noLaTeX || lyxrc.print_command == "none"; disable = noLaTeX || lyxrc.print_command == "none";
break; break;
@ -510,27 +481,6 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
else if (argument == "linuxdoc") else if (argument == "linuxdoc")
disable = lyxrc.linuxdoc_to_lyx_command == "none"; disable = lyxrc.linuxdoc_to_lyx_command == "none";
break; 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: case LFUN_UNDO:
disable = buf->undostack.empty(); disable = buf->undostack.empty();
break; break;
@ -651,7 +601,7 @@ string const LyXFunc::Dispatch(string const & s)
string line = frontStrip(s); string line = frontStrip(s);
string arg = strip(frontStrip(split(line, cmd, ' '))); 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 // this is better
pseudoaction = pseudoaction =
lyxaction.searchActionArg(action, lyxaction.searchActionArg(action,
argument.c_str()); argument);
if (pseudoaction == -1) { if (pseudoaction == -1) {
pseudoaction = action; pseudoaction = action;
@ -840,8 +790,8 @@ string const LyXFunc::Dispatch(int ac,
if (!searched_string.empty() && if (!searched_string.empty() &&
((action == LFUN_WORDFINDBACKWARD) ? ((action == LFUN_WORDFINDBACKWARD) ?
ltCur->SearchBackward(owner->view(), searched_string.c_str()) : ltCur->SearchBackward(owner->view(), searched_string) :
ltCur->SearchForward(owner->view(), searched_string.c_str()))) { ltCur->SearchForward(owner->view(), searched_string))) {
// ??? What is that ??? // ??? What is that ???
owner->view()->update(BufferView::SELECT|BufferView::FITCUR); owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
@ -966,7 +916,6 @@ string const LyXFunc::Dispatch(int ac,
reloadBuffer(); reloadBuffer();
break; break;
#ifdef NEW_EXPORT
case LFUN_UPDATE: case LFUN_UPDATE:
Exporter::Export(owner->buffer(), argument, true); Exporter::Export(owner->buffer(), argument, true);
break; break;
@ -974,23 +923,6 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_PREVIEW: case LFUN_PREVIEW:
Exporter::Preview(owner->buffer(), argument); Exporter::Preview(owner->buffer(), argument);
break; 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: case LFUN_BUILDPROG:
MenuBuildProg(owner->buffer()); MenuBuildProg(owner->buffer());
@ -1009,11 +941,7 @@ string const LyXFunc::Dispatch(int ac,
break; break;
case LFUN_EXPORT: case LFUN_EXPORT:
#ifdef NEW_EXPORT
Exporter::Export(owner->buffer(), argument, false); Exporter::Export(owner->buffer(), argument, false);
#else
MenuExport(owner->buffer(), argument);
#endif
break; break;
case LFUN_IMPORT: case LFUN_IMPORT:
@ -1428,11 +1356,7 @@ string const LyXFunc::Dispatch(int ac,
break; break;
case LFUN_LAYOUT_DOCUMENT: case LFUN_LAYOUT_DOCUMENT:
#ifdef USE_OLD_DOCUMENT_LAYOUT
MenuLayoutDocument();
#else
owner->getDialogs()->showLayoutDocument(); owner->getDialogs()->showLayoutDocument();
#endif
break; break;
case LFUN_LAYOUT_PARAGRAPH: case LFUN_LAYOUT_PARAGRAPH:
@ -1447,16 +1371,6 @@ string const LyXFunc::Dispatch(int ac,
MenuLayoutCharacter(); MenuLayoutCharacter();
break; break;
#if 0
case LFUN_LAYOUT_TABLE:
{
int flag = 0;
if (argument == "true") flag = 1;
MenuLayoutTable(flag);
}
break;
#endif
case LFUN_LAYOUT_TABULAR: case LFUN_LAYOUT_TABULAR:
if (owner->view()->the_locking_inset) { if (owner->view()->the_locking_inset) {
if (owner->view()->the_locking_inset->LyxCode()==Inset::TABULAR_CODE) { if (owner->view()->the_locking_inset->LyxCode()==Inset::TABULAR_CODE) {
@ -1472,18 +1386,6 @@ string const LyXFunc::Dispatch(int ac,
} }
break; 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: case LFUN_LAYOUT_PREAMBLE:
MenuLayoutPreamble(); MenuLayoutPreamble();
break; break;
@ -1573,7 +1475,7 @@ string const LyXFunc::Dispatch(int ac,
break; break;
case LFUN_INSERT_LABEL: case LFUN_INSERT_LABEL:
MenuInsertLabel(argument.c_str()); MenuInsertLabel(argument);
break; break;
case LFUN_REF_INSERT: case LFUN_REF_INSERT:
@ -2405,7 +2307,7 @@ string const LyXFunc::Dispatch(int ac,
{ {
int r = 2, c = 2; int r = 2, c = 2;
if (!argument.empty()) if (!argument.empty())
sscanf(argument.c_str(),"%d%d", &r, &c); ::sscanf(argument.c_str(),"%d%d", &r, &c);
InsetTabular * new_inset = InsetTabular * new_inset =
new InsetTabular(owner->buffer(), r, c); new InsetTabular(owner->buffer(), r, c);
if (owner->view()->insertInset(new_inset)) if (owner->view()->insertInset(new_inset))
@ -2442,7 +2344,7 @@ string const LyXFunc::Dispatch(int ac,
{ {
int x; int x;
long y; 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); owner->view()->text->SetCursorFromCoordinates(owner->view(), x, y);
} }
break; break;
@ -2495,7 +2397,7 @@ string const LyXFunc::Dispatch(int ac,
{ {
char file_name[100]; char file_name[100];
int row; 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 // Must replace extension of the file to be .lyx and get full path
string s = ChangeExtension(string(file_name), ".lyx"); string s = ChangeExtension(string(file_name), ".lyx");
@ -2535,7 +2437,7 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_APROPOS: case LFUN_APROPOS:
case LFUN_GETTIP: case LFUN_GETTIP:
{ {
int qa = lyxaction.LookupFunc(argument.c_str()); int const qa = lyxaction.LookupFunc(argument);
setMessage(lyxaction.helpText(static_cast<kb_action>(qa))); setMessage(lyxaction.helpText(static_cast<kb_action>(qa)));
} }
break; break;
@ -2656,7 +2558,7 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_INSERT_MATH: case LFUN_INSERT_MATH:
{ {
math_insert_symbol(argument.c_str()); math_insert_symbol(argument);
} }
break; break;
@ -2675,7 +2577,7 @@ string const LyXFunc::Dispatch(int ac,
setErrorMessage(N_("Missing argument")); setErrorMessage(N_("Missing argument"));
else { else {
string s1 = token(s, ' ', 1); string s1 = token(s, ' ', 1);
int na = s1.empty() ? 0: atoi(s1.c_str()); int na = s1.empty() ? 0 : lyx::atoi(s1);
owner->view()-> owner->view()->
open_new_inset(new InsetFormulaMacro(token(s, ' ', 0), na)); open_new_inset(new InsetFormulaMacro(token(s, ' ', 0), na));
} }
@ -2919,10 +2821,6 @@ string const LyXFunc::Dispatch(int ac,
} }
break; break;
#endif #endif
case LFUN_BUFFERBULLETSSELECT:
bulletForm();
break;
case LFUN_TOGGLECURSORFOLLOW: case LFUN_TOGGLECURSORFOLLOW:
cursor_follows_scrollbar = !cursor_follows_scrollbar; cursor_follows_scrollbar = !cursor_follows_scrollbar;
break; break;
@ -2981,7 +2879,7 @@ string const LyXFunc::Dispatch(int ac,
else else
arg = lyxrc.date_insert_format; arg = lyxrc.date_insert_format;
char datetmp[32]; 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++) { for (int i = 0; i < datetmp_len; i++) {
owner->view()->text->InsertChar(owner->view(), datetmp[i]); owner->view()->text->InsertChar(owner->view(), datetmp[i]);
owner->view()->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); owner->view()->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);

View File

@ -177,7 +177,7 @@ string const LyXLex::getLongString(string const & endtoken)
} }
if (!prefix.empty() if (!prefix.empty()
&& prefixIs(tmpstr, prefix.c_str())) { && prefixIs(tmpstr, prefix)) {
tmpstr.erase(0, prefix.length() - 1); tmpstr.erase(0, prefix.length() - 1);
} }
str += frontStrip(tmpstr, "\t") + '\n'; str += frontStrip(tmpstr, "\t") + '\n';

View File

@ -933,15 +933,14 @@ int LyXRC::read(string const & filename)
break; break;
} }
if ((action = lyxaction.LookupFunc(cmd.c_str()))>= 0) { if ((action = lyxaction.LookupFunc(cmd))>= 0) {
if (lyxerr.debugging(Debug::KBMAP)) { if (lyxerr.debugging(Debug::KBMAP)) {
lyxerr << "RC_BIND: Sequence `" lyxerr << "RC_BIND: Sequence `"
<< seq << "' Command `" << seq << "' Command `"
<< cmd << "' Action `" << cmd << "' Action `"
<< action << '\'' << endl; << action << '\'' << endl;
} }
res = toplevel_keymap->bind(seq.c_str(), res = toplevel_keymap->bind(seq, action);
action);
if (res != 0) { if (res != 0) {
lexrc.printError( lexrc.printError(
"Invalid key sequence `" "Invalid key sequence `"

View File

@ -55,6 +55,7 @@
#include "debug.h" #include "debug.h"
#include "LyXAction.h" #include "LyXAction.h"
#include "support/lstrings.h" #include "support/lstrings.h"
#include "support/lyxlib.h"
#ifdef __EMX__ #ifdef __EMX__
#include <cstdlib> #include <cstdlib>
@ -115,7 +116,7 @@ void LyXComm::openConnection() {
NP_NOWAIT|0x01, 0600, 0600, 0); NP_NOWAIT|0x01, 0600, 0600, 0);
if (rc == ERROR_PIPE_BUSY) { if (rc == ERROR_PIPE_BUSY) {
#else #else
if (access(tmp.c_str(), F_OK) == 0) { if (::access(tmp.c_str(), F_OK) == 0) {
#endif #endif
lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n" lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n"
<< "If no other LyX program is active, please delete" << "If no other LyX program is active, please delete"
@ -124,12 +125,12 @@ void LyXComm::openConnection() {
return; return;
} }
#ifndef __EMX__ #ifndef __EMX__
if (mkfifo(tmp.c_str(), 0600) < 0) { if (::mkfifo(tmp.c_str(), 0600) < 0) {
lyxerr << "LyXComm: Could not create pipe " << tmp << '\n' lyxerr << "LyXComm: Could not create pipe " << tmp << '\n'
<< strerror(errno) << endl; << strerror(errno) << endl;
return; return;
}; };
infd = open(tmp.c_str(), O_RDONLY|O_NONBLOCK); infd = ::open(tmp.c_str(), O_RDONLY|O_NONBLOCK);
#else #else
if (rc != NO_ERROR) { if (rc != NO_ERROR) {
errnum = TranslateOS2Error(rc); errnum = TranslateOS2Error(rc);
@ -161,7 +162,7 @@ void LyXComm::openConnection() {
tmp = pipename + ".out"; tmp = pipename + ".out";
#ifndef __EMX__ #ifndef __EMX__
if (access(tmp.c_str(), F_OK) == 0) { if (::access(tmp.c_str(), F_OK) == 0) {
#else #else
rc = DosCreateNPipe(tmp.c_str(), &fd, NP_ACCESS_DUPLEX, rc = DosCreateNPipe(tmp.c_str(), &fd, NP_ACCESS_DUPLEX,
NP_NOWAIT|0x01, 0600, 0600, 0); NP_NOWAIT|0x01, 0600, 0600, 0);
@ -175,17 +176,17 @@ void LyXComm::openConnection() {
return; return;
} }
#ifndef __EMX__ #ifndef __EMX__
if (mkfifo(tmp.c_str(), 0600) < 0) { if (::mkfifo(tmp.c_str(), 0600) < 0) {
lyxerr << "LyXComm: Could not create pipe " << tmp << '\n' lyxerr << "LyXComm: Could not create pipe " << tmp << '\n'
<< strerror(errno) << endl; << strerror(errno) << endl;
return; return;
}; };
if (access(tmp.c_str(), F_OK) != 0) { if (::access(tmp.c_str(), F_OK) != 0) {
lyxerr << "LyXComm: Pipe " << tmp lyxerr << "LyXComm: Pipe " << tmp
<< " does not exist" << endl; << " does not exist" << endl;
return; return;
} }
outfd = open(tmp.c_str(), O_RDWR); outfd = ::open(tmp.c_str(), O_RDWR);
#else #else
if (rc != NO_ERROR) { if (rc != NO_ERROR) {
errnum = TranslateOS2Error(rc); errnum = TranslateOS2Error(rc);
@ -257,7 +258,7 @@ void LyXComm::closeConnection() {
<< '\n' << strerror(errno) << endl; << '\n' << strerror(errno) << endl;
} }
#ifndef __EMX__ // OS/2 named pipes will be automatically removed. #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 lyxerr << "LyXComm: Could not remove pipe " << tmp
<< '\n' << strerror(errno) << endl; << '\n' << strerror(errno) << endl;
}; };
@ -274,12 +275,12 @@ void LyXComm::closeConnection() {
return; return;
} }
#endif #endif
if (close(outfd) < 0) { if (::close(outfd) < 0) {
lyxerr << "LyXComm: Could not close pipe " << tmp lyxerr << "LyXComm: Could not close pipe " << tmp
<< '\n' << strerror(errno) << endl; << '\n' << strerror(errno) << endl;
} }
#ifndef __EMX__ #ifndef __EMX__
if (unlink(tmp.c_str()) < 0){ if (lyx::unlink(tmp) < 0){
lyxerr << "LyXComm: Could not remove pipe " << tmp lyxerr << "LyXComm: Could not remove pipe " << tmp
<< '\n' << strerror(errno) << endl; << '\n' << strerror(errno) << endl;
}; };
@ -375,7 +376,7 @@ void LyXComm::send(string const & msg) {
if (!ready) { if (!ready) {
lyxerr << "LyXComm: Pipes are closed. Could not send " lyxerr << "LyXComm: Pipes are closed. Could not send "
<< msg << endl; << 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 lyxerr << "LyXComm: Error sending message: " << msg
<< '\n' << strerror(errno) << '\n' << strerror(errno)
<< "\nLyXComm: Resetting connection" << endl; << "\nLyXComm: Resetting connection" << endl;
@ -523,7 +524,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
// connect to the lyxfunc in the single LyXView we // connect to the lyxfunc in the single LyXView we
// support currently. (Lgb) // support currently. (Lgb)
int action = lyxaction.LookupFunc(cmd.c_str()); int action = lyxaction.LookupFunc(cmd);
//int action = -1; //int action = -1;
string rval, buf; string rval, buf;

View File

@ -284,10 +284,6 @@ public:
/// ///
void CursorRight(BufferView *, bool internal = true) const; 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 CursorLeftOneWord(BufferView *) const;
/// ///
void CursorRightOneWord(BufferView *) const; void CursorRightOneWord(BufferView *) const;

View File

@ -295,5 +295,5 @@ void LyXVC::showLog()
string tmpf = tmpnam(0); string tmpf = tmpnam(0);
vcs->getLog(tmpf); vcs->getLog(tmpf);
viewLog(tmpf); viewLog(tmpf);
unlink(tmpf.c_str()); lyx::unlink(tmpf);
} }

View File

@ -45,7 +45,8 @@ using std::endl;
using std::vector; using std::vector;
using std::max; using std::max;
extern char * mathed_label; //extern char * mathed_label;
extern string mathed_label;
extern char const * latex_special_chars; extern char const * latex_special_chars;
@ -325,7 +326,7 @@ int InsetFormula::Latex(Buffer const *, ostream & os, bool fragile, bool) const
int ret = 0; int ret = 0;
//#warning Alejandro, the number of lines is not returned in this case //#warning Alejandro, the number of lines is not returned in this case
// This problem will disapear at 0.13. // 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; return ret;
} }
@ -365,7 +366,9 @@ void InsetFormula::Read(Buffer const *, LyXLex & lex)
mathed_parser_file(is, lex.GetLineNo()); mathed_parser_file(is, lex.GetLineNo());
// Silly hack to read labels. // Silly hack to read labels.
mathed_label = 0; //mathed_label = 0;
mathed_label.erase();
mathed_parse(0, 0, &par); mathed_parse(0, 0, &par);
par->Metrics(); par->Metrics();
disp_flag = (par->GetType() > 0); disp_flag = (par->GetType() > 0);
@ -373,9 +376,11 @@ void InsetFormula::Read(Buffer const *, LyXLex & lex)
// Update line number // Update line number
lex.setLineNo(mathed_parser_lineno()); lex.setLineNo(mathed_parser_lineno());
if (mathed_label) { //if (mathed_label) {
if (!mathed_label.empty()) {
label = mathed_label; label = mathed_label;
mathed_label = 0; //mathed_label = 0;
mathed_label.erase();
} }
// reading of end_inset in the inset!!! // reading of end_inset in the inset!!!
@ -941,7 +946,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
case LFUN_MATH_SIZE: case LFUN_MATH_SIZE:
if (!arg.empty()) { 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; int sz = (l) ? l->id: -1;
mathcursor->SetSize(sz); mathcursor->SetSize(sz);
UpdateLocal(bv); UpdateLocal(bv);
@ -951,7 +956,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
case LFUN_INSERT_MATH: case LFUN_INSERT_MATH:
{ {
bv->lockedInsetStoreUndo(Undo::INSERT); bv->lockedInsetStoreUndo(Undo::INSERT);
InsertSymbol(bv, arg.c_str()); InsertSymbol(bv, arg);
break; break;
} }
@ -997,7 +1002,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
if (n > 0) { if (n > 0) {
if (isdigit(lf[0])) if (isdigit(lf[0]))
ilf = atoi(lf); ilf = lyx::atoi(lf);
else else
if (lf[1]) { if (lf[1]) {
l = in_word_set(lf, strlen(lf)); l = in_word_set(lf, strlen(lf));
@ -1009,7 +1014,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
if (n > 1) { if (n > 1) {
if (isdigit(rg[0])) if (isdigit(rg[0]))
irg = atoi(rg); irg = lyx::atoi(rg);
else else
if (rg[1]) { if (rg[1]) {
l = in_word_set(rg, strlen(rg)); l = in_word_set(rg, strlen(rg));
@ -1051,7 +1056,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
if (!lb.empty() && lb[0] > ' ') { if (!lb.empty() && lb[0] > ' ') {
SetNumber(true); SetNumber(true);
if (par->GetType() == LM_OT_MPARN) { if (par->GetType() == LM_OT_MPARN) {
mathcursor->setLabel(lb.c_str()); mathcursor->setLabel(lb);
// MathMatrixInset *mt = (MathMatrixInset*)par; // MathMatrixInset *mt = (MathMatrixInset*)par;
// mt->SetLabel(lb); // mt->SetLabel(lb);
} else { } else {

View File

@ -45,7 +45,7 @@ InsetFormulaMacro::InsetFormulaMacro()
InsetFormulaMacro::InsetFormulaMacro(string nm, int na, bool /*e*/) InsetFormulaMacro::InsetFormulaMacro(string nm, int na, bool /*e*/)
: InsetFormula(true), name(nm) : InsetFormula(true), name(nm)
{ {
tmacro = MathMacroTable::mathMTable.getTemplate(name.c_str()); tmacro = MathMacroTable::mathMTable.getTemplate(name);
if (!tmacro) { if (!tmacro) {
tmacro = new MathMacroTemplate(name.c_str(), na); tmacro = new MathMacroTemplate(name.c_str(), na);
MathMacroTable::mathMTable.addTemplate(tmacro); MathMacroTable::mathMTable.addTemplate(tmacro);
@ -206,7 +206,7 @@ InsetFormulaMacro::LocalDispatch(BufferView * bv,
int action, string const & arg) int action, string const & arg)
{ {
if (action == LFUN_MATH_MACROARG) { if (action == LFUN_MATH_MACROARG) {
int i = atoi(arg.c_str()) - 1; int i = lyx::atoi(arg) - 1;
if (i >= 0 && i < tmacro->getNoArgs()) { if (i >= 0 && i < tmacro->getNoArgs()) {
mathcursor->Insert(tmacro->getMacroPar(i), LM_TC_INSET); mathcursor->Insert(tmacro->getMacroPar(i), LM_TC_INSET);
InsetFormula::UpdateLocal(bv); InsetFormula::UpdateLocal(bv);

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h" #include "gettext.h"
@ -55,7 +55,7 @@ FD_panel *create_form_panel(void)
fl_set_object_callback(obj, button_cb, MM_SQRT); fl_set_object_callback(obj, button_cb, MM_SQRT);
fdui->frac = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 40, 15, 30, 30, ""); 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_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); fl_set_object_callback(obj, button_cb, MM_FRAC);
fdui->delim = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 50, 30, 30, ""); fdui->delim = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 50, 30, 30, "");
fl_set_object_color(obj, FL_MCOL, FL_BLUE); 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_set_object_callback(obj, button_cb, MM_SPACE);
fl_end_form(); fl_end_form();
//fdui->panel->fdui = fdui; fdui->panel->fdui = fdui;
return fdui; return fdui;
} }
@ -85,7 +85,7 @@ FD_delim *create_form_delim(void)
fdui->delim = fl_bgn_form(FL_NO_BOX, 250, 260); fdui->delim = fl_bgn_form(FL_NO_BOX, 250, 260);
obj = fl_add_box(FL_UP_BOX, 0, 0, 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, ""); 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); fl_set_object_callback(obj, delim_cb, 2);
fdui->lado = fl_bgn_group(); 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_set_object_callback(obj, delim_cb, MM_OK);
fl_end_form(); fl_end_form();
//fdui->delim->fdui = fdui; fdui->delim->fdui = fdui;
return fdui; return fdui;
} }
@ -158,7 +158,7 @@ FD_matrix *create_form_matrix(void)
fl_set_object_callback(obj, matrix_cb, MM_APPLY); fl_set_object_callback(obj, matrix_cb, MM_APPLY);
fl_end_form(); fl_end_form();
//fdui->matrix->fdui = fdui; fdui->matrix->fdui = fdui;
return fdui; return fdui;
} }
@ -172,14 +172,14 @@ FD_deco *create_form_deco(void)
fdui->deco = fl_bgn_form(FL_NO_BOX, 160, 150); fdui->deco = fl_bgn_form(FL_NO_BOX, 160, 150);
obj = fl_add_box(FL_UP_BOX, 0, 0, 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, ""); 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); fl_set_object_callback(obj, deco_cb, MM_APPLY);
obj = fl_add_button(FL_RETURN_BUTTON, 30, 110, 100, 30, _("Close")); obj = fl_add_button(FL_RETURN_BUTTON, 30, 110, 100, 30, _("Close"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, deco_cb, MM_CLOSE); fl_set_object_callback(obj, deco_cb, MM_CLOSE);
fl_end_form(); fl_end_form();
//fdui->deco->fdui = fdui; fdui->deco->fdui = fdui;
return fdui; return fdui;
} }
@ -231,7 +231,7 @@ FD_space *create_form_space(void)
fl_end_form(); fl_end_form();
//fdui->space->fdui = fdui; fdui->space->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -376,7 +376,7 @@ MathedInset * MathMatrixInset::Clone()
void MathMatrixInset::SetAlign(char vv, string const & hh) void MathMatrixInset::SetAlign(char vv, string const & hh)
{ {
v_align = vv; v_align = vv;
strncpy(h_align, hh.c_str(), nc); ::strncpy(h_align, hh.c_str(), nc);
} }

View File

@ -254,7 +254,7 @@ void MathMacroArgument::Write(ostream & os, bool fragile)
/* --------------------- MathMacroTemplate ---------------------------*/ /* --------------------- 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), MathParInset(LM_ST_TEXT, nm, LM_OT_MACRO),
flags(flg), nargs(na) flags(flg), nargs(na)
{ {

View File

@ -142,7 +142,7 @@ class MathMacroTemplate: public MathParInset {
public: public:
/// A template constructor needs all the data /// A template constructor needs all the data
explicit explicit
MathMacroTemplate(char const *, int na = 0, int f = 0); MathMacroTemplate(string const &, int na = 0, int f = 0);
/// ///
~MathMacroTemplate(); ~MathMacroTemplate();
/// ///

View File

@ -16,7 +16,7 @@
*/ */
#include <config.h> #include <config.h>
#include <cstdlib>
#include <cctype> #include <cctype>
#ifdef __GNUG__ #ifdef __GNUG__
@ -29,6 +29,7 @@
#include "math_macro.h" #include "math_macro.h"
#include "math_root.h" #include "math_root.h"
#include "debug.h" #include "debug.h"
#include "support/lyxlib.h"
using std::istream; using std::istream;
using std::endl; using std::endl;
@ -45,12 +46,15 @@ enum {
FLAG_BRACK_END = 256 // Next ] ends the parsing process FLAG_BRACK_END = 256 // Next ] ends the parsing process
}; };
static
YYSTYPE yylval; 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[] = { char const * latex_mathenv[] = {
"math", "math",
@ -62,10 +66,12 @@ char const * latex_mathenv[] = {
}; };
char const * latex_mathspace[] = { char const * latex_mathspace[] = {
"!", ",", ":", ";", "quad", "qquad" "!", ",", ":", ";", "quad", "qquad"
}; };
char const * latex_special_chars = "#$%&_{}"; char const * latex_special_chars = "#$%&_{}";
// These are lexical codes, not semantic // These are lexical codes, not semantic
@ -92,15 +98,6 @@ static int yylineno;
static istream * yyis; static istream * yyis;
static bool yy_mtextmode= false; 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 static
void mathPrintError(string const & msg) void mathPrintError(string const & msg)
{ {
@ -142,9 +139,6 @@ void LexInitCodes()
static static
char LexGetArg(char lf, bool accept_spaces= false) char LexGetArg(char lf, bool accept_spaces= false)
{ {
char rg;
char * p = &yytext[0];
int bcnt = 1;
unsigned char c; unsigned char c;
char cc; char cc;
while (yyis->good()) { while (yyis->good()) {
@ -158,12 +152,15 @@ char LexGetArg(char lf, bool accept_spaces= false)
break; break;
} }
} }
rg = (lf == '{') ? '}': ((lf == '[') ? ']': ((lf == '(') ? ')': 0)); char const rg =
(lf == '{') ? '}' : ((lf == '[') ? ']' : ((lf == '(') ? ')' : 0));
if (!rg) { if (!rg) {
lyxerr << "Math parse error: unknown bracket '" lyxerr << "Math parse error: unknown bracket '"
<< lf << "'" << endl; << lf << "'" << endl;
return '\0'; return '\0';
} }
char * p = &yytext[0];
int bcnt = 1;
do { do {
yyis->get(cc); yyis->get(cc);
c = cc; c = cc;
@ -180,11 +177,11 @@ static
int yylex(void) int yylex(void)
{ {
static int init_done = 0; static int init_done = 0;
unsigned char c;
char cc;
if (!init_done) LexInitCodes(); if (!init_done) LexInitCodes();
unsigned char c;
char cc;
while (yyis->good()) { while (yyis->good()) {
yyis->get(cc); yyis->get(cc);
c = cc; c = cc;
@ -192,37 +189,71 @@ int yylex(void)
if (yy_mtextmode && c == ' ') { if (yy_mtextmode && c == ' ') {
yylval.i= ' '; yylval.i= ' ';
return LM_TK_ALPHA; return LM_TK_ALPHA;
} } else
if (lexcode[c] == LexNewLine) { if (lexcode[c] == LexNewLine) {
++yylineno; ++yylineno;
continue; continue;
} } else
if (lexcode[c] == LexComment) if (lexcode[c] == LexComment) {
do { yyis->get(cc); c = cc; } while (c != '\n' % yyis->good()); // eat comments 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] == LexDigit
if (lexcode[c] == LexAlpha) { yylval.i= c; return LM_TK_ALPHA; } || lexcode[c] == LexOther
if (lexcode[c] == LexBOP) { yylval.i= c; return LM_TK_BOP; } || lexcode[c] == LexMathSpace) {
if (lexcode[c] == LexSelf) { return c; } 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) { if (lexcode[c] == LexArgument) {
yyis->get(cc); yyis->get(cc);
c = cc; c = cc;
yylval.i = c - '0'; yylval.i = c - '0';
return LM_TK_ARGUMENT; return LM_TK_ARGUMENT;
} } else
if (lexcode[c] == LexOpen) { return LM_TK_OPEN; } if (lexcode[c] == LexOpen) {
if (lexcode[c] == LexClose) { return LM_TK_CLOSE; } return LM_TK_OPEN;
} else
if (lexcode[c] == LexClose) {
return LM_TK_CLOSE;
} else
if (lexcode[c] == LexESC) { if (lexcode[c] == LexESC) {
yyis->get(cc); yyis->get(cc);
c = cc; c = cc;
if (c == '\\') { return LM_TK_NEWLINE; } if (c == '\\') {
if (c == '(') { yylval.i = LM_EN_INTEXT; return LM_TK_BEGIN; } return LM_TK_NEWLINE;
if (c == ')') { yylval.i = LM_EN_INTEXT; return LM_TK_END; } }
if (c == '[') { yylval.i = LM_EN_DISPLAY; return LM_TK_BEGIN; } if (c == '(') {
if (c == ']') { yylval.i = LM_EN_DISPLAY; return LM_TK_END; } 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)) { if (strchr(latex_special_chars, c)) {
yylval.i = c; yylval.i = c;
return LM_TK_SPECIAL; return LM_TK_SPECIAL;
@ -270,6 +301,7 @@ int yylex(void)
} }
static
int parse_align(char * hor, char *) int parse_align(char * hor, char *)
{ {
int nc = 0; int nc = 0;
@ -279,9 +311,12 @@ int parse_align(char * hor, char *)
// Accent hacks only for 0.12. Stolen from Cursor. // Accent hacks only for 0.12. Stolen from Cursor.
static
int accent = 0; int accent = 0;
static
int nestaccent[8]; int nestaccent[8];
static
void setAccent(int ac) void setAccent(int ac)
{ {
if (ac > 0 && accent < 8) { if (ac > 0 && accent < 8) {
@ -291,6 +326,7 @@ void setAccent(int ac)
} }
static
MathedInset * doAccent(byte c, MathedTextCodes t) MathedInset * doAccent(byte c, MathedTextCodes t)
{ {
MathedInset * ac = 0; MathedInset * ac = 0;
@ -307,6 +343,7 @@ MathedInset * doAccent(byte c, MathedTextCodes t)
} }
static
MathedInset * doAccent(MathedInset * p) MathedInset * doAccent(MathedInset * p)
{ {
MathedInset * ac = 0; MathedInset * ac = 0;
@ -326,7 +363,8 @@ MathedInset * doAccent(MathedInset * p)
LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
MathParInset ** mtx) MathParInset ** mtx)
{ {
int t = yylex(), tprev = 0; int t = yylex();
int tprev = 0;
bool panic = false; bool panic = false;
static int plevel = -1; static int plevel = -1;
static int size = LM_ST_TEXT; static int size = LM_ST_TEXT;
@ -375,15 +413,15 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
int na = 0; int na = 0;
LexGetArg('{'); LexGetArg('{');
// This name lives until quitting, for that reason string const name(&yytext[1]);
// I didn't care on deleting explicitly. Later I will.
char const * name = strnew(&yytext[1]);
// ugly trick to be removed soon (lyx3) // ugly trick to be removed soon (lyx3)
char c; yyis->get(c); //char c; yyis->get(c);
yyis->putback(c); //yyis->putback(c);
char const c = yyis->peek();
if (c == '[') { if (c == '[') {
LexGetArg('['); LexGetArg('[');
na = atoi(yytext); na = lyx::atoi(yytext);
} }
macro = new MathMacroTemplate(name, na); macro = new MathMacroTemplate(name, na);
flags = FLAG_BRACE|FLAG_BRACE_LAST; flags = FLAG_BRACE|FLAG_BRACE_LAST;
@ -454,7 +492,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
{ {
if (flags & FLAG_BRACK_ARG) { if (flags & FLAG_BRACK_ARG) {
flags &= ~FLAG_BRACK_ARG; flags &= ~FLAG_BRACK_ARG;
char rg = LexGetArg('['); char const rg = LexGetArg('[');
if (rg != ']') { if (rg != ']') {
mathPrintError("Expected ']'"); mathPrintError("Expected ']'");
panic = true; panic = true;
@ -613,13 +651,12 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
case LM_TK_LEFT: case LM_TK_LEFT:
{ {
int lfd, rgd; int lfd = yylex();
lfd = yylex();
if (lfd == LM_TK_SYM || lfd == LM_TK_STR || lfd == LM_TK_BOP|| lfd == LM_TK_SPECIAL) 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; lfd = (lfd == LM_TK_SYM) ? yylval.l->id: yylval.i;
// lyxerr << "L[" << lfd << " " << lfd << "]"; // lyxerr << "L[" << lfd << " " << lfd << "]";
LyxArrayBase * a = mathed_parse(FLAG_RIGHT); LyxArrayBase * a = mathed_parse(FLAG_RIGHT);
rgd = yylex(); int rgd = yylex();
// lyxerr << "R[" << rgd << "]"; // lyxerr << "R[" << rgd << "]";
if (rgd == LM_TK_SYM || rgd == LM_TK_STR || rgd == LM_TK_BOP || rgd == LM_TK_SPECIAL) 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; rgd = (rgd == LM_TK_SYM) ? yylval.l->id: yylval.i;
@ -657,7 +694,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
break; break;
} }
case LM_TK_ACCENT: setAccent(yylval.l->id); break; case LM_TK_ACCENT:
setAccent(yylval.l->id);
break;
case LM_TK_NONUM: case LM_TK_NONUM:
{ {
@ -729,13 +768,12 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
rg = LexGetArg('{'); rg = LexGetArg('{');
} }
strcpy(ar, yytext); strcpy(ar, yytext);
int nc = parse_align(ar, ar2); int const nc = parse_align(ar, ar2);
MathParInset * mm = new MathMatrixInset(nc, 0); MathParInset * mm = new MathMatrixInset(nc, 0);
mm->SetAlign(ar2[0], ar); mm->SetAlign(ar2[0], ar);
data.Insert(mm, LM_TC_ACTIVE_INSET); data.Insert(mm, LM_TC_ACTIVE_INSET);
mathed_parse(FLAG_END, mm->GetData(), &mm); mathed_parse(FLAG_END, mm->GetData(), &mm);
} else } else if (yylval.i >= LM_EN_INTEXT && yylval.i<= LM_EN_EQNARRAY) {
if (yylval.i >= LM_EN_INTEXT && yylval.i<= LM_EN_EQNARRAY) {
if (plevel!= 0) { if (plevel!= 0) {
mathPrintError("Misplaced environment"); mathPrintError("Misplaced environment");
break; break;
@ -797,7 +835,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
case LM_TK_LABEL: case LM_TK_LABEL:
{ {
char rg = LexGetArg('\0', true); char const rg = LexGetArg('\0', true);
if (rg != '}') { if (rg != '}') {
mathPrintError("Expected '{'"); mathPrintError("Expected '{'");
// debug info // debug info
@ -806,15 +844,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
break; break;
} }
if (crow) { if (crow) {
// This is removed by crow's destructor. Bad design? yes, this crow->setLabel(yytext);
// will be changed after 0.12 } else {
crow->setLabel(strnew(yytext)); mathed_label = yytext;
}
else {
// where is this math_label free'ed?
// Supposedly in ~formula, another bad hack,
// give me some time please.
mathed_label = strnew(yytext);
} }
#ifdef DEBUG #ifdef DEBUG
lyxerr << "Label[" << mathed_label << "]" << endl; lyxerr << "Label[" << mathed_label << "]" << endl;
@ -831,7 +863,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
if (panic) { if (panic) {
lyxerr << " Math Panic, expect problems!" << endl; lyxerr << " Math Panic, expect problems!" << endl;
// Search for the end command. // Search for the end command.
do t = yylex (); while (t != LM_TK_END && t); do {
t = yylex ();
} while (t != LM_TK_END && t);
} else } else
t = yylex (); t = yylex ();

View File

@ -136,6 +136,4 @@ union YYSTYPE {
latexkeys * l; latexkeys * l;
}; };
extern YYSTYPE yylval;
#endif #endif

View File

@ -1955,7 +1955,7 @@ void LyXParagraph::SetOnlyLayout(BufferParams const & bparams,
p1 = ppar->pextra_width, p1 = ppar->pextra_width,
p2 = ppar->pextra_widthp; p2 = ppar->pextra_widthp;
ppar->SetPExtraType(bparams, ppar->pextra_type, ppar->SetPExtraType(bparams, ppar->pextra_type,
p1.c_str(), p2.c_str()); p1, p2);
} }
if ((par->pextra_type == PEXTRA_NONE) && if ((par->pextra_type == PEXTRA_NONE) &&
npar && (npar->pextra_type != PEXTRA_NONE)) { npar && (npar->pextra_type != PEXTRA_NONE)) {
@ -1963,7 +1963,7 @@ void LyXParagraph::SetOnlyLayout(BufferParams const & bparams,
p1 = npar->pextra_width, p1 = npar->pextra_width,
p2 = npar->pextra_widthp; p2 = npar->pextra_widthp;
npar->SetPExtraType(bparams, npar->pextra_type, 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, p1 = ppar->pextra_width,
p2 = ppar->pextra_widthp; p2 = ppar->pextra_widthp;
ppar->SetPExtraType(bparams, ppar->pextra_type, ppar->SetPExtraType(bparams, ppar->pextra_type,
p1.c_str(), p2.c_str()); p1, p2);
} }
if ((par->pextra_type == PEXTRA_NONE) && if ((par->pextra_type == PEXTRA_NONE) &&
npar && (npar->pextra_type != PEXTRA_NONE)) { npar && (npar->pextra_type != PEXTRA_NONE)) {
@ -2032,7 +2032,7 @@ void LyXParagraph::SetLayout(BufferParams const & bparams,
p1 = npar->pextra_width, p1 = npar->pextra_width,
p2 = npar->pextra_widthp; p2 = npar->pextra_widthp;
npar->SetPExtraType(bparams, npar->pextra_type, 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; need_closing = true;
} }
//BufferParams * params = &current_view->buffer()->params;
bool footer_in_body = true; bool footer_in_body = true;
switch (footnotekind) { switch (footnotekind) {
case LyXParagraph::FOOTNOTE: case LyXParagraph::FOOTNOTE:
@ -3507,7 +3506,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(Buffer const * buf,
<< pextra_width << "}\n"; << pextra_width << "}\n";
else else
os << "\\begin{floatingfigure}{" os << "\\begin{floatingfigure}{"
<< atoi(pextra_widthp.c_str())/100.0 << lyx::atoi(pextra_widthp) / 100.0
<< "\\textwidth}\n"; << "\\textwidth}\n";
} else { } else {
os << "\\begin{figure}"; os << "\\begin{figure}";

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h" #include "gettext.h"
@ -51,7 +51,7 @@ FD_form_sendto *create_form_form_sendto(void)
fl_end_form(); fl_end_form();
//fdui->form_sendto->fdui = fdui; fdui->form_sendto->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -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 <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.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_set_object_callback(obj, SpellOptionsApplyCB, 0);
fl_end_form(); fl_end_form();
//fdui->form_spell_options->fdui = fdui; fdui->form_spell_options->fdui = fdui;
return 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_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_end_form(); fl_end_form();
//fdui->form_spell_check->fdui = fdui; fdui->form_spell_check->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -488,7 +488,7 @@ bool sc_still_alive() {
static static
void sc_clean_up_after_error() void sc_clean_up_after_error()
{ {
fclose(out); ::fclose(out);
} }
// Send word to ispell and get reply // Send word to ispell and get reply
@ -497,11 +497,11 @@ isp_result * sc_check_word(string const & word)
{ {
//Please rewrite to use string. //Please rewrite to use string.
fputs(word.c_str(), out); ::fputs(word.c_str(), out);
fputc('\n', out); ::fputc('\n', out);
char buf[1024]; char buf[1024];
fgets(buf, 1024, in); ::fgets(buf, 1024, in);
/* I think we have to check if ispell is still alive here because /* I think we have to check if ispell is still alive here because
the signal-handler could have disabled blocking on the fd */ the signal-handler could have disabled blocking on the fd */
@ -565,28 +565,28 @@ void close_spell_checker()
static inline static inline
void sc_insert_word(string const & word) void sc_insert_word(string const & word)
{ {
fputc('*', out); // Insert word in personal dictionary ::fputc('*', out); // Insert word in personal dictionary
fputs(word.c_str(), out); ::fputs(word.c_str(), out);
fputc('\n', out); ::fputc('\n', out);
} }
static inline static inline
void sc_accept_word(string const & word) void sc_accept_word(string const & word)
{ {
fputc('@', out); // Accept in this session ::fputc('@', out); // Accept in this session
fputs(word.c_str(), out); ::fputs(word.c_str(), out);
fputc('\n', out); ::fputc('\n', out);
} }
static inline static inline
void sc_store_replacement(string const & mis, string const & cor) { void sc_store_replacement(string const & mis, string const & cor) {
if(actual_spell_checker == ASC_ASPELL) { if(actual_spell_checker == ASC_ASPELL) {
fputs("$$ra ", out); ::fputs("$$ra ", out);
fputs(mis.c_str(), out); ::fputs(mis.c_str(), out);
fputc(',', out); ::fputc(',', out);
fputs(cor.c_str(), out); ::fputs(cor.c_str(), out);
fputc('\n', out); ::fputc('\n', out);
} }
} }
@ -599,7 +599,7 @@ void init_spell_checker(BufferParams const &, string const & lang)
{ {
PspellConfig * config = new_pspell_config(); PspellConfig * config = new_pspell_config();
string code; string code;
(void)split(lang, code, '_'); split(lang, code, '_');
config->replace("language-tag", code.c_str()); config->replace("language-tag", code.c_str());
spell_error_object = new_pspell_manager(config); spell_error_object = new_pspell_manager(config);
if (pspell_error_number(spell_error_object) != 0) { if (pspell_error_number(spell_error_object) != 0) {
@ -629,6 +629,7 @@ static
isp_result * sc_check_word(string const & word) isp_result * sc_check_word(string const & word)
{ {
isp_result * result = new isp_result; isp_result * result = new isp_result;
#warning Why isnt word_ok a bool? (Lgb)
int word_ok = pspell_manager_check(sc, word.c_str()); int word_ok = pspell_manager_check(sc, word.c_str());
Assert(word_ok != -1); Assert(word_ok != -1);

View File

@ -140,9 +140,9 @@ void FileInfo::init()
void FileInfo::dostat(bool link) void FileInfo::dostat(bool link)
{ {
if (link) { if (link) {
status = lstat(fname.c_str(), &buf); status = ::lstat(fname.c_str(), &buf);
} else { } else {
status = stat(fname.c_str(), &buf); status = ::stat(fname.c_str(), &buf);
} }
if (status) err = errno; if (status) err = errno;
} }
@ -386,3 +386,6 @@ bool FileInfo::access(int p)
return false; return false;
} }
} }

View File

@ -59,9 +59,9 @@ struct LRegex::Impl {
{ {
regmatch_t tmp; regmatch_t tmp;
regexec(preg, str.c_str(), 1, &tmp, 0); 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; 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; static_cast<unsigned int>(tmp.rm_eo) : string::npos;
return make_pair(first, second - first); return make_pair(first, second - first);
} }
@ -72,7 +72,7 @@ struct LRegex::Impl {
size_t nr = regerror(error_code, preg, 0, 0); size_t nr = regerror(error_code, preg, 0, 0);
char * tmp = new char[nr]; char * tmp = new char[nr];
regerror(error_code, preg, tmp, nr); regerror(error_code, preg, tmp, nr);
string ret(tmp); string const ret(tmp);
delete [] tmp; delete [] tmp;
return ret; return ret;
} }
@ -88,7 +88,8 @@ struct LRegex::Impl {
// func much faster, but client code will be simpler, // func much faster, but client code will be simpler,
// because then it will only be needed to scan through // because then it will only be needed to scan through
// all the entries in matches. // 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]; regmatch_t * mat = new regmatch_t[subs];
unsigned int first = 0; unsigned int first = 0;
unsigned int second = 0; unsigned int second = 0;

View File

@ -43,7 +43,7 @@ LSubstring::LSubstring(string & s, string::value_type const * p)
LSubstring::LSubstring(string & s, LRegex const & r) LSubstring::LSubstring(string & s, LRegex const & r)
: ps(&s) : ps(&s)
{ {
LRegex::MatchPair res = r.first_match(s); LRegex::MatchPair const res = r.first_match(s);
if (res.first != string::npos) { if (res.first != string::npos) {
n = res.second; n = res.second;
pos = res.first; pos = res.first;

View File

@ -31,6 +31,7 @@ libsupport_la_SOURCES = \
StrPool.C \ StrPool.C \
StrPool.h \ StrPool.h \
abort.C \ abort.C \
atoi.C \
block.h \ block.h \
chdir.C \ chdir.C \
copy.C \ copy.C \
@ -52,6 +53,7 @@ libsupport_la_SOURCES = \
path.h \ path.h \
putenv.C \ putenv.C \
rename.C \ rename.C \
rmdir.C \
sstream.h \ sstream.h \
$(REGEX) syscall.C \ $(REGEX) syscall.C \
syscall.h \ syscall.h \
@ -60,4 +62,5 @@ libsupport_la_SOURCES = \
syssingleton.C \ syssingleton.C \
translator.h \ translator.h \
textutils.h \ textutils.h \
unlink.C \
utility.hpp utility.hpp

10
src/support/atoi.C Normal file
View File

@ -0,0 +1,10 @@
#include <config.h>
#include <cstdlib>
#include "lyxlib.h"
int lyx::atoi(string const & nstr)
{
return ::atoi(nstr.c_str());
}

View File

@ -12,3 +12,12 @@ int lyx::chdir(char const * name)
return ::_chdir2(name); return ::_chdir2(name);
#endif #endif
} }
int lyx::chdir(string const & name)
{
#ifndef __EMX__
return ::chdir(name.c_str());
#else
return ::_chdir2(name.c_str());
#endif
}

View File

@ -2,20 +2,12 @@
#include <fstream> #include <fstream>
//#include <stdio.h>
#include "support/lyxlib.h" #include "support/lyxlib.h"
#include "LString.h" #include "LString.h"
//#include "support/syscall.h"
#include "support/filetools.h" #include "support/filetools.h"
bool lyx::copy(string const & from, string const & to) bool lyx::copy(string const & from, string const & to)
{ {
#if 0
string command = "cp " + QuoteName(from) + " " + QuoteName(to);
return Systemcalls().startscript(Systemcalls::System,
command) == 0;
#else
std::ifstream ifs(from.c_str()); std::ifstream ifs(from.c_str());
if (!ifs) return false; if (!ifs) return false;
std::ofstream ofs(to.c_str(), std::ios::out|std::ios::trunc); std::ofstream ofs(to.c_str(), std::ios::out|std::ios::trunc);
@ -23,5 +15,4 @@ bool lyx::copy(string const & from, string const & to)
ofs << ifs.rdbuf(); ofs << ifs.rdbuf();
if (ofs.good()) return true; if (ofs.good()) return true;
return false; return false;
#endif
} }

View File

@ -74,14 +74,14 @@ bool IsLyXFilename(string const & filename)
string const MakeLatexName(string const & file) string const MakeLatexName(string const & file)
{ {
string name = OnlyFilename(file); string name = OnlyFilename(file);
string path = OnlyPath(file); string const path = OnlyPath(file);
for (string::size_type i = 0; i < name.length(); ++i) { for (string::size_type i = 0; i < name.length(); ++i) {
name[i] &= 0x7f; // set 8th bit to 0 name[i] &= 0x7f; // set 8th bit to 0
}; };
// ok so we scan through the string twice, but who cares. // ok so we scan through the string twice, but who cares.
string keep("abcdefghijklmnopqrstuvwxyz" string const keep("abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"@!\"'()*+,-./0123456789:;<=>?[]`|"); "@!\"'()*+,-./0123456789:;<=>?[]`|");
@ -167,7 +167,7 @@ int IsFileWriteable (string const & path)
// -1: error- couldn't find out // -1: error- couldn't find out
int IsDirWriteable (string const & path) int IsDirWriteable (string const & path)
{ {
string tmpfl(TmpFileName(path)); string const tmpfl(TmpFileName(path));
if (tmpfl.empty()) { if (tmpfl.empty()) {
WriteFSAlert(_("LyX Internal Error!"), WriteFSAlert(_("LyX Internal Error!"),
@ -227,7 +227,7 @@ string const FileSearch(string const & path, string const & name,
{ {
// if `name' is an absolute path, we ignore the setting of `path' // if `name' is an absolute path, we ignore the setting of `path'
// Expand Environmentvariables in 'name' // Expand Environmentvariables in 'name'
string tmpname = ReplaceEnvironmentPath(name); string const tmpname = ReplaceEnvironmentPath(name);
string fullname = MakeAbsPath(tmpname, path); string fullname = MakeAbsPath(tmpname, path);
// search first without extension, then with it. // search first without extension, then with it.
@ -272,12 +272,12 @@ string const
i18nLibFileSearch(string const & dir, string const & name, i18nLibFileSearch(string const & dir, string const & name,
string const & ext) string const & ext)
{ {
string lang = token(string(GetEnv("LANG")), '_', 0); string const lang = token(string(GetEnv("LANG")), '_', 0);
if (lang.empty() || lang == "C") if (lang.empty() || lang == "C")
return LibFileSearch(dir, name, ext); return LibFileSearch(dir, name, ext);
else { else {
string tmp = LibFileSearch(dir, lang + '_' + name, string const tmp = LibFileSearch(dir, lang + '_' + name,
ext); ext);
if (!tmp.empty()) if (!tmp.empty())
return tmp; return tmp;
@ -290,8 +290,8 @@ i18nLibFileSearch(string const & dir, string const & name,
string const GetEnv(string const & envname) string const GetEnv(string const & envname)
{ {
// f.ex. what about error checking? // f.ex. what about error checking?
char const * const ch = getenv(envname.c_str()); char const * const ch = ::getenv(envname.c_str());
string envstr = !ch ? "" : ch; string const envstr = !ch ? "" : ch;
return envstr; return envstr;
} }
@ -299,9 +299,9 @@ string const GetEnv(string const & envname)
string const GetEnvPath(string const & name) string const GetEnvPath(string const & name)
{ {
#ifndef __EMX__ #ifndef __EMX__
string pathlist = subst(GetEnv(name), ':', ';'); string const pathlist = subst(GetEnv(name), ':', ';');
#else #else
string pathlist = subst(GetEnv(name), '\\', '/'); string const pathlist = subst(GetEnv(name), '\\', '/');
#endif #endif
return strip(pathlist, ';'); return strip(pathlist, ';');
} }
@ -324,7 +324,7 @@ bool PutEnv(string const & envstr)
char * leaker = new char[envstr.length() + 1]; char * leaker = new char[envstr.length() + 1];
envstr.copy(leaker, envstr.length()); envstr.copy(leaker, envstr.length());
leaker[envstr.length()] = '\0'; leaker[envstr.length()] = '\0';
int retval = lyx::putenv(leaker); int const retval = lyx::putenv(leaker);
// If putenv does not make a copy of the char const * this // If putenv does not make a copy of the char const * this
// is very dangerous. OTOH if it does take a copy this is the // is very dangerous. OTOH if it does take a copy this is the
@ -337,11 +337,11 @@ bool PutEnv(string const & envstr)
#else #else
#ifdef HAVE_SETENV #ifdef HAVE_SETENV
string varname; string varname;
string str = envstr.split(varname,'='); string const str = envstr.split(varname,'=');
int retval = setenv(varname.c_str(), str.c_str(), true); int const retval = ::setenv(varname.c_str(), str.c_str(), true);
#else #else
// No environment setting function. Can this happen? // No environment setting function. Can this happen?
int retval = 1; //return an error condition. int const retval = 1; //return an error condition.
#endif #endif
#endif #endif
return retval == 0; return retval == 0;
@ -372,12 +372,12 @@ int DeleteAllFilesInDir (string const & path)
// if (filename == "." || filename == "..") // if (filename == "." || filename == "..")
// continue; // continue;
// string unlinkpath(AddName(path, filename)); // string unlinkpath(AddName(path, filename));
// if (remove(unlinkpath.c_str())) // if (lyx::unlink(unlinkpath))
// WriteFSAlert(_("Error! Could not remove file:"), // WriteFSAlert(_("Error! Could not remove file:"),
// unlinkpath); // unlinkpath);
// } // }
// return 0; // return 0;
DIR * dir = opendir(path.c_str()); DIR * dir = ::opendir(path.c_str());
if (!dir) { if (!dir) {
WriteFSAlert (_("Error! Cannot open directory:"), path); WriteFSAlert (_("Error! Cannot open directory:"), path);
return -1; return -1;
@ -385,17 +385,17 @@ int DeleteAllFilesInDir (string const & path)
struct dirent * de; struct dirent * de;
int return_value = 0; int return_value = 0;
while ((de = readdir(dir))) { while ((de = readdir(dir))) {
string temp = de->d_name; string const temp = de->d_name;
if (temp == "." || temp == "..") if (temp == "." || temp == "..")
continue; continue;
string unlinkpath = AddName (path, temp); string const unlinkpath = AddName (path, temp);
lyxerr.debug() << "Deleting file: " << unlinkpath << endl; lyxerr.debug() << "Deleting file: " << unlinkpath << endl;
bool deleted = true; bool deleted = true;
if (FileInfo(unlinkpath).isDir()) if (FileInfo(unlinkpath).isDir())
deleted = (DeleteAllFilesInDir(unlinkpath) == 0); deleted = (DeleteAllFilesInDir(unlinkpath) == 0);
deleted &= (remove(unlinkpath.c_str()) == 0); deleted &= (lyx::unlink(unlinkpath) == 0);
if (!deleted) { if (!deleted) {
WriteFSAlert (_("Error! Could not remove file:"), WriteFSAlert (_("Error! Could not remove file:"),
unlinkpath); unlinkpath);
@ -410,9 +410,9 @@ int DeleteAllFilesInDir (string const & path)
static static
string const CreateTmpDir(string const & tempdir, string const & mask) string const CreateTmpDir(string const & tempdir, string const & mask)
{ {
string tmpfl(TmpFileName(tempdir, mask)); string const tmpfl(TmpFileName(tempdir, mask));
if ((tmpfl.empty()) || lyx::mkdir (tmpfl.c_str(), 0777)) { if ((tmpfl.empty()) || lyx::mkdir(tmpfl, 0777)) {
WriteFSAlert(_("Error! Couldn't create temporary directory:"), WriteFSAlert(_("Error! Couldn't create temporary directory:"),
tempdir); tempdir);
return string(); return string();
@ -428,7 +428,7 @@ int DestroyTmpDir (string const & tmpdir, bool Allfiles)
Path p(user_lyxdir); Path p(user_lyxdir);
#endif #endif
if (Allfiles && DeleteAllFilesInDir(tmpdir)) return -1; if (Allfiles && DeleteAllFilesInDir(tmpdir)) return -1;
if (rmdir(tmpdir.c_str())) { if (lyx::rmdir(tmpdir)) {
WriteFSAlert(_("Error! Couldn't delete temporary directory:"), WriteFSAlert(_("Error! Couldn't delete temporary directory:"),
tmpdir); tmpdir);
return -1; return -1;
@ -452,11 +452,11 @@ int DestroyBufferTmpDir (string const & tmpdir)
string const CreateLyXTmpDir(string const & deflt) string const CreateLyXTmpDir(string const & deflt)
{ {
if ((!deflt.empty()) && (deflt != "/tmp")) { if ((!deflt.empty()) && (deflt != "/tmp")) {
if (lyx::mkdir(deflt.c_str(), 0777)) { if (lyx::mkdir(deflt, 0777)) {
#ifdef __EMX__ #ifdef __EMX__
Path p(user_lyxdir); Path p(user_lyxdir);
#endif #endif
string t(CreateTmpDir (deflt.c_str(), "lyx_tmp")); string const t(CreateTmpDir(deflt, "lyx_tmp"));
return t; return t;
} else } else
return deflt; return deflt;
@ -464,7 +464,7 @@ string const CreateLyXTmpDir (string const & deflt)
#ifdef __EMX__ #ifdef __EMX__
Path p(user_lyxdir); Path p(user_lyxdir);
#endif #endif
string t(CreateTmpDir ("/tmp", "lyx_tmp")); string const t(CreateTmpDir("/tmp", "lyx_tmp"));
return t; return t;
} }
} }
@ -487,7 +487,7 @@ bool createDirectory(string const & path, int permission)
return false; return false;
} }
if (lyx::mkdir(temp.c_str(), permission)) { if (lyx::mkdir(temp, permission)) {
WriteFSAlert (_("Error! Couldn't create directory:"), temp); WriteFSAlert (_("Error! Couldn't create directory:"), temp);
return false; return false;
} }
@ -611,7 +611,7 @@ string const MakeAbsPath(string const & RelPath, string const & BasePath)
string const AddName(string const & path, string const & fname) string const AddName(string const & path, string const & fname)
{ {
// Get basename // Get basename
string basename(OnlyFilename(fname)); string const basename(OnlyFilename(fname));
string buf; string buf;
@ -661,7 +661,7 @@ string const ExpandPath(string const & path)
return RTemp; return RTemp;
string Temp; string Temp;
string copy(RTemp); string const copy(RTemp);
// Split by next / // Split by next /
RTemp = split(RTemp, Temp, '/'); RTemp = split(RTemp, Temp, '/');
@ -904,7 +904,7 @@ string const MakeRelPath(string const & abspath0, string const & basepath0)
string const AddPath(string const & path, string const & path_2) string const AddPath(string const & path, string const & path_2)
{ {
string buf; string buf;
string path2 = CleanupPath(path_2); string const path2 = CleanupPath(path_2);
if (!path.empty() && path != "." && path != "./") { if (!path.empty() && path != "." && path != "./") {
buf = CleanupPath(path); buf = CleanupPath(path);
@ -932,7 +932,7 @@ string const AddPath(string const & path, string const & path_2)
string const string const
ChangeExtension(string const & oldname, string const & extension) ChangeExtension(string const & oldname, string const & extension)
{ {
string::size_type last_slash = oldname.rfind('/'); string::size_type const last_slash = oldname.rfind('/');
string::size_type last_dot = oldname.rfind('.'); string::size_type last_dot = oldname.rfind('.');
if (last_dot < last_slash && last_slash != string::npos) if (last_dot < last_slash && last_slash != string::npos)
last_dot = string::npos; last_dot = string::npos;
@ -951,8 +951,8 @@ ChangeExtension(string const & oldname, string const & extension)
/// Return the extension of the file (not including the .) /// Return the extension of the file (not including the .)
string const GetExtension(string const & name) string const GetExtension(string const & name)
{ {
string::size_type last_slash = name.rfind('/'); string::size_type const last_slash = name.rfind('/');
string::size_type last_dot = name.rfind('.'); string::size_type const last_dot = name.rfind('.');
if (last_dot != string::npos && if (last_dot != string::npos &&
(last_slash == string::npos || last_dot > last_slash)) (last_slash == string::npos || last_dot > last_slash))
return name.substr(last_dot + 1, return name.substr(last_dot + 1,
@ -1017,7 +1017,8 @@ bool LyXReadLink(string const & File, string & Link)
{ {
char LinkBuffer[512]; char LinkBuffer[512];
// Should be PATH_MAX but that needs autconf support // Should be PATH_MAX but that needs autconf support
int nRead = readlink(File.c_str(), LinkBuffer, sizeof(LinkBuffer)-1); int const nRead = ::readlink(File.c_str(),
LinkBuffer, sizeof(LinkBuffer) - 1);
if (nRead <= 0) if (nRead <= 0)
return false; return false;
LinkBuffer[nRead] = 0; LinkBuffer[nRead] = 0;
@ -1035,7 +1036,7 @@ cmdret const do_popen(string const & cmd)
// of course the best would be to have a // of course the best would be to have a
// pstream (process stream), with the // pstream (process stream), with the
// variants ipstream, opstream // variants ipstream, opstream
FILE * inf = popen(cmd.c_str(), "r"); FILE * inf = ::popen(cmd.c_str(), "r");
string ret; string ret;
int c = fgetc(inf); int c = fgetc(inf);
while (c != EOF) { while (c != EOF) {
@ -1103,7 +1104,7 @@ void removeAutosaveFile(string const & filename)
a += '#'; a += '#';
FileInfo fileinfo(a); FileInfo fileinfo(a);
if (fileinfo.exist()) { if (fileinfo.exist()) {
if (::remove(a.c_str()) != 0) { if (lyx::unlink(a) != 0) {
WriteFSAlert(_("Could not delete auto-save file!"), a); WriteFSAlert(_("Could not delete auto-save file!"), a);
} }
} }

View File

@ -33,6 +33,7 @@ using std::tolower;
using std::toupper; using std::toupper;
#endif #endif
int compare_no_case(string const & s, string const & s2) int compare_no_case(string const & s, string const & s2)
{ {
// ANSI C // ANSI C
@ -84,7 +85,7 @@ bool isStrInt(string const & str)
if (str.empty()) return false; if (str.empty()) return false;
// Remove leading and trailing white space chars. // Remove leading and trailing white space chars.
string tmpstr = frontStrip(strip(str, ' '), ' '); string const tmpstr = frontStrip(strip(str, ' '), ' ');
if (tmpstr.empty()) return false; if (tmpstr.empty()) return false;
string::const_iterator cit = tmpstr.begin(); string::const_iterator cit = tmpstr.begin();
@ -101,9 +102,9 @@ int strToInt(string const & str)
{ {
if (isStrInt(str)) { if (isStrInt(str)) {
// Remove leading and trailing white space chars. // Remove leading and trailing white space chars.
string tmpstr = frontStrip(strip(str, ' '), ' '); string const tmpstr = frontStrip(strip(str, ' '), ' ');
// Do the conversion proper. // Do the conversion proper.
return atoi(tmpstr.c_str()); return lyx::atoi(tmpstr);
} else { } else {
return 0; return 0;
} }
@ -115,7 +116,7 @@ bool isStrDbl(string const & str)
if (str.empty()) return false; if (str.empty()) return false;
// Remove leading and trailing white space chars. // Remove leading and trailing white space chars.
string tmpstr = frontStrip(strip(str, ' '), ' '); string const tmpstr = frontStrip(strip(str, ' '), ' ');
if (tmpstr.empty()) return false; if (tmpstr.empty()) return false;
// if (1 < tmpstr.count('.')) return false; // if (1 < tmpstr.count('.')) return false;
@ -144,9 +145,9 @@ double strToDbl(string const & str)
{ {
if (isStrDbl(str)) { if (isStrDbl(str)) {
// Remove leading and trailing white space chars. // Remove leading and trailing white space chars.
string tmpstr = frontStrip(strip(str, ' '), ' '); string const tmpstr = frontStrip(strip(str, ' '), ' ');
// Do the conversion proper. // Do the conversion proper.
return atof(tmpstr.c_str()); return ::atof(tmpstr.c_str());
} else { } else {
return 0.0; return 0.0;
} }
@ -203,8 +204,10 @@ bool prefixIs(string const & a, char const * pre)
{ {
Assert(pre); Assert(pre);
unsigned int l = strlen(pre); unsigned int const l = strlen(pre);
if (l > a.length() || a.empty()) string::size_type const alen = a.length();
if (l > alen || a.empty())
return false; return false;
else { else {
#if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD) #if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD)
@ -221,6 +224,23 @@ bool prefixIs(string const & a, char const * pre)
} }
bool prefixIs(string const & a, string const & pre)
{
string::size_type const prelen = pre.length();
string::size_type const alen = a.length();
if (prelen < alen || a.empty())
return false;
else {
#if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD)
return ::strncmp(a.c_str(), pre.c_str(), prelen) == 0;
#else
return a.compare(0, prelen, pre) == 0;
#endif
}
}
bool suffixIs(string const & a, char c) bool suffixIs(string const & a, char c)
{ {
if (a.empty()) return false; if (a.empty()) return false;
@ -251,22 +271,37 @@ bool suffixIs(string const & a, char const * suf)
} }
bool suffixIs(string const & a, string const & suf)
{
string::size_type const suflen = suf.length();
string::size_type const alen = a.length();
if (suflen > alen) {
return false;
} else {
#if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD)
string tmp(a, alen - suflen);
return ::strncmp(tmp.c_str(), suf.c_str(), suflen) == 0;
#else
return a.compare(alen - suflen, suflen, suf);
#endif
}
}
bool contains(char const * a, string const & b) bool contains(char const * a, string const & b)
{ {
Assert(a); Assert(a);
string const at(a);
if (!*a || b.empty()) return false; return contains(at, b);
return strstr(a, b.c_str()) != 0;
} }
bool contains(string const & a, char const * b) bool contains(string const & a, char const * b)
{ {
Assert(b); Assert(b);
string const bt(b);
if (a.empty()) return contains(a, bt);
return false;
return a.find(b) != string::npos;
} }
@ -281,9 +316,9 @@ bool contains(string const & a, string const & b)
bool contains(char const * a, char const * b) bool contains(char const * a, char const * b)
{ {
Assert(a && b); Assert(a && b);
string const at(a);
if (!*a || !*b) return false; string const bt(b);
return strstr(a, b) != 0; return contains(at, bt);
} }
@ -415,6 +450,21 @@ string const subst(string const & a,
} }
string const subst(string const & a,
string const & oldstr, string const & newstr)
{
string lstr(a);
string::size_type i = 0;
string::size_type const olen = oldstr.length();
while((i = lstr.find(oldstr, i)) != string::npos) {
lstr.replace(i, olen, newstr);
i += newstr.length(); // We need to be sure that we dont
// use the same i over and over again.
}
return lstr;
}
string const strip(string const & a, char c) string const strip(string const & a, char c)
{ {
if (a.empty()) return a; if (a.empty()) return a;

Some files were not shown because too many files have changed in this diff Show More