From d6665cba427b04ae37f42c846398cad518d2be0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 26 Sep 2000 13:54:57 +0000 Subject: [PATCH] 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 --- ChangeLog | 58 + development/Code_rules/Rules | 16 +- forms/bullet_forms.C.patch | 45 - forms/bullet_forms.fd | 452 --- forms/bullet_forms.h.patch | 23 - forms/fdfix.sh | 18 +- forms/form1.fd | 124 +- forms/layout_forms.fd | 3722 +----------------------- forms/layout_forms.h.patch | 71 +- forms/makefile | 12 +- po/POTFILES.in | 4 - src/BufferView2.C | 6 +- src/Chktex.C | 3 +- src/DepTable.C | 13 +- src/FontInfo.C | 3 +- src/FontLoader.C | 1 - src/LaTeX.C | 8 +- src/LyXAction.C | 22 - src/LyXSendto.C | 24 +- src/LyXView.C | 17 - src/LyXView.h | 4 +- src/Makefile.am | 5 - src/MenuBackend.C | 4 +- src/PaperLayout.C | 282 -- src/ParagraphExtra.C | 320 -- src/PrinterParams.h | 8 +- src/buffer.C | 230 +- src/buffer.h | 3 - src/bufferlist.C | 8 +- src/bufferparams.C | 2 +- src/bufferview_funcs.C | 10 +- src/bullet_forms.C | 113 - src/bullet_forms.h | 50 - src/bullet_forms_cb.C | 246 -- src/chset.C | 7 +- src/commandtags.h | 15 - src/converter.C | 8 +- src/counters.C | 4 +- src/credits_form.C | 4 +- src/exporter.h | 3 - src/filedlg.C | 5 +- src/font.C | 6 +- src/form1.C | 46 +- src/form1.h | 17 - src/frontends/Liason.C | 59 - src/frontends/xforms/FormDocument.C | 2 +- src/frontends/xforms/FormError.h | 2 +- src/frontends/xforms/Menubar_pimpl.C | 2 +- src/frontends/xforms/Toolbar_pimpl.C | 2 +- src/frontends/xforms/Toolbar_pimpl.h | 2 +- src/frontends/xforms/forms/makefile | 7 +- src/graphics/GraphicsCache.C | 2 +- src/graphics/GraphicsCacheItem_pimpl.C | 4 +- src/insets/ExternalTemplate.h | 2 +- src/insets/figinset.C | 10 +- src/insets/insetbib.C | 6 +- src/insets/insetcollapsable.C | 8 +- src/insets/insetexternal.C | 16 +- src/insets/insetfloat.C | 3 +- src/insets/insetinclude.C | 60 +- src/insets/insettabular.C | 244 +- src/insets/insettabular.h | 16 +- src/insets/lyxinset.h | 36 +- src/kbsequence.C | 4 +- src/layout_forms.C | 703 +---- src/layout_forms.h | 252 +- src/log_form.C | 4 +- src/lyx.C | 8 +- src/lyx_cb.C | 1912 +----------- src/lyx_cb.h | 1 + src/lyx_gui.C | 134 +- src/lyx_gui_misc.C | 56 +- src/lyx_main.C | 27 +- src/lyx_sendfax.C | 8 +- src/lyx_sendfax_main.C | 4 +- src/lyxfr1.C | 8 +- src/lyxfunc.C | 128 +- src/lyxlex.C | 2 +- src/lyxrc.C | 5 +- src/lyxserver.C | 27 +- src/lyxtext.h | 4 - src/lyxvc.C | 2 +- src/mathed/formula.C | 25 +- src/mathed/formulamacro.C | 4 +- src/mathed/math_forms.C | 18 +- src/mathed/math_inset.C | 2 +- src/mathed/math_macro.C | 2 +- src/mathed/math_macro.h | 2 +- src/mathed/math_panel.C | 6 +- src/mathed/math_parser.C | 178 +- src/mathed/math_parser.h | 2 - src/paragraph.C | 13 +- src/print_form.C | 4 +- src/sp_form.C | 6 +- src/spellchecker.C | 39 +- src/support/FileInfo.C | 7 +- src/support/LRegex.C | 9 +- src/support/LSubstring.C | 2 +- src/support/Makefile.am | 3 + src/support/StrPool.C | 2 +- src/support/atoi.C | 10 + src/support/chdir.C | 9 + src/support/copy.C | 9 - src/support/filetools.C | 85 +- src/support/lstrings.C | 88 +- src/support/lstrings.h | 13 +- src/support/lyxlib.h | 30 +- src/support/lyxstring.C | 33 +- src/support/lyxsum.C | 6 + src/support/mkdir.C | 15 +- src/support/path.C | 2 +- src/support/path.h | 2 +- src/support/rename.C | 7 +- src/support/rmdir.C | 10 + src/support/syscall.C | 2 +- src/support/unlink.C | 10 + src/tabular.C | 183 +- src/text.C | 58 +- src/text2.C | 21 +- src/trans_mgr.C | 2 +- src/vspace.C | 2 +- 121 files changed, 1241 insertions(+), 9494 deletions(-) delete mode 100644 forms/bullet_forms.C.patch delete mode 100644 forms/bullet_forms.fd delete mode 100644 forms/bullet_forms.h.patch delete mode 100644 src/PaperLayout.C delete mode 100644 src/ParagraphExtra.C delete mode 100644 src/bullet_forms.C delete mode 100644 src/bullet_forms.h delete mode 100644 src/bullet_forms_cb.C create mode 100644 src/support/atoi.C create mode 100644 src/support/rmdir.C create mode 100644 src/support/unlink.C diff --git a/ChangeLog b/ChangeLog index 665d509373..faf0a38f2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,61 @@ +2000-09-26 Lars Gullik Bjønnes + + * 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 * src/buffer.C (readFile): make sure that the whole version number diff --git a/development/Code_rules/Rules b/development/Code_rules/Rules index 7e2ed08ab3..7e7aaecf52 100644 --- a/development/Code_rules/Rules +++ b/development/Code_rules/Rules @@ -114,6 +114,20 @@ in C++. -NOT- T add(...); +- Avoid using the default cases in switch statements unless you have + too. Use the correct type for the switch expression and let the + compiler ensure that all cases are exhausted. + + enum Foo { + foo, + bar + }; + Foo f = ...; + switch (f) { + case foo: ...; break; + case bar: ...; break; + default: ...; break; // not needed and would shadow a wrong use of Foo + } Exceptions ---------- @@ -318,7 +332,7 @@ Formatting * Using external GUI constructors (XForms fdesign) - Fdesign generated files should not be changed at all. The only changes - needed are gettext, compability with 0.81 or when you have made your own + needed are gettext, compability with 0.88 or when you have made your own xforms objects and have just a dummy in the .fd file in place of your own. In case you have to change the generated files for any of the reasons above, you should provide a patch against the clean generated diff --git a/forms/bullet_forms.C.patch b/forms/bullet_forms.C.patch deleted file mode 100644 index 2d43561c0b..0000000000 --- a/forms/bullet_forms.C.patch +++ /dev/null @@ -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 - #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(); diff --git a/forms/bullet_forms.fd b/forms/bullet_forms.fd deleted file mode 100644 index 0407de087f..0000000000 --- a/forms/bullet_forms.fd +++ /dev/null @@ -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 diff --git a/forms/bullet_forms.h.patch b/forms/bullet_forms.h.patch deleted file mode 100644 index 6fbbe6aa25..0000000000 --- a/forms/bullet_forms.h.patch +++ /dev/null @@ -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; diff --git a/forms/fdfix.sh b/forms/fdfix.sh index 0e47641fd0..15c5135895 100755 --- a/forms/fdfix.sh +++ b/forms/fdfix.sh @@ -24,7 +24,7 @@ if [ -f "$2.patch" ]; then patch -s $1 < "$2.patch" fi -echo "// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext" > $2 +echo "// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext" > $2 echo "#include " >> $2 echo "#include \"lyx_gui_misc.h\"" >> $2 echo "#include \"gettext.h\"" >> $2 @@ -56,16 +56,6 @@ echo >> $2 # For all lines containing "fl_add" and a string containing |, add the # shortcut command after the end of this line # -# -e 's/fl_set_object_lcolor/fl_set_object_lcol/' -# -# For all lines replace "fl_set_object_lcolor" with "fl_set_object_lcol" -# This will be removed when we don't support 0.81 -# -# -e 's/fdui->.*->fdui = fdui/\/\/&/' -# -# For all lines replace "fdui->...->fdui" with "//fdui->...->fdui" -# This will be removed when we don't support 0.81 -# # -e 's/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/' # # Some picky/broken compilers (eg AIX's xlC) don't like evaluating @@ -79,7 +69,9 @@ echo >> $2 # Someone got busy and put spaces in after commas but didn't allow for the # autogeneration of the files so their pretty formatting got lost. Not anymore. # The second rule cleans up one special case where a comma appears at the end -# of a string while ensuring "...", "..." isn't affected. +# of a string while ensuring "...", "..." isn't affected. Update: this seems +# to have not been fixed in fdesign 0.56 (xforms 0.89), we should probably +# report it once more. (Lgb) # # -e 's/stdlib.h/cstdlib/' # @@ -105,8 +97,6 @@ cat $1 | sed \ -e '/shortcut/ s/".*[|].*"/scex(_(&))/' \ -e '/fl_add/ s/".*[|].*"/idex(_(&))/' \ -e '/fl_add/ s/idex(\(.*\)").*$/&fl_set_button_shortcut(obj,scex(\1")),1);/' \ --e 's/fl_set_object_lcolor/fl_set_object_lcol/' \ --e 's/fdui->.*->fdui = fdui/\/\/&/' \ -e 's/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/' \ -e 's/,\([^ ]\)/, \1/g' \ -e 's/\("[^"][^"]*,\) \("\)/\1\2/g' \ diff --git a/forms/form1.fd b/forms/form1.fd index a5dcbcaac3..1ac333c4aa 100644 --- a/forms/form1.fd +++ b/forms/form1.fd @@ -3,7 +3,7 @@ Magic: 13000 Internal Form Definition File (do not change) -Number of forms: 5 +Number of forms: 4 Unit of measure: FL_COORD_PIXEL =============== FORM =============== @@ -249,7 +249,7 @@ argument: -------------------- class: FL_BEGIN_GROUP type: 0 -box: 0 0 0 0 +box: 0 10 10 0 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER @@ -687,7 +687,7 @@ argument: 2 -------------------- class: FL_BEGIN_GROUP type: 0 -box: 0 0 0 0 +box: 0 10 10 0 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER @@ -867,7 +867,7 @@ argument: -------------------- class: FL_BEGIN_GROUP type: 0 -box: 0 0 0 0 +box: 0 10 10 0 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER @@ -975,7 +975,7 @@ argument: -------------------- class: FL_BEGIN_GROUP type: 0 -box: 0 0 0 0 +box: 0 10 10 0 boxtype: FL_NO_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_CENTER @@ -1392,120 +1392,6 @@ name: timer callback: argument: -=============== FORM =============== -Name: form_table -Width: 310 -Height: 130 -Number of Objects: 6 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 310 130 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 10 90 90 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: OK -shortcut: ^M -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_ok -callback: TableOKCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 110 90 90 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Apply|#A -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_apply -callback: TableApplyCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 210 90 90 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Cancel|^[ -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_cancel -callback: TableCancelCB -argument: 0 - --------------------- -class: FL_VALSLIDER -type: HOR_SLIDER -box: 80 50 220 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Columns -shortcut: -resize: FL_RESIZE_X -gravity: FL_NoGravity FL_NoGravity -name: slider_columns -callback: -argument: - --------------------- -class: FL_VALSLIDER -type: HOR_SLIDER -box: 80 10 220 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Rows -shortcut: -resize: FL_RESIZE_X -gravity: FL_NoGravity FL_NoGravity -name: slider_rows -callback: -argument: - =============== FORM =============== Name: form_search Width: 440 diff --git a/forms/layout_forms.fd b/forms/layout_forms.fd index 7561f29f71..d29fcd32cc 100644 --- a/forms/layout_forms.fd +++ b/forms/layout_forms.fd @@ -3,20 +3,20 @@ Magic: 13000 Internal Form Definition File (do not change) -Number of forms: 9 +Number of forms: 2 Unit of measure: FL_COORD_PIXEL SnapGrid: 5 =============== FORM =============== -Name: form_document -Width: 580 -Height: 430 -Number of Objects: 39 +Name: form_character +Width: 300 +Height: 415 +Number of Objects: 16 -------------------- class: FL_BOX type: UP_BOX -box: 0 0 580 430 +box: 0 0 300 415 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -34,107 +34,53 @@ argument: -------------------- class: FL_FRAME type: ENGRAVED_FRAME -box: 290 110 120 70 +box: 10 325 280 45 boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 +colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE +size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 300 100 100 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Separation -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast name: callback: argument: -------------------- -class: FL_BEGIN_GROUP -type: 0 -box: 0 0 0 0 +class: FL_FRAME +type: ENGRAVED_FRAME +box: 10 265 280 45 boxtype: FL_NO_BOX -colors: FL_COL1 FL_MCOL +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: group_radio_separation -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 290 120 110 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Indent|#I -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: radio_indent -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 290 150 110 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Skip|#K -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: radio_skip +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: callback: argument: -------------------- -class: FL_END_GROUP -type: 0 -box: 0 0 0 0 +class: FL_FRAME +type: ENGRAVED_FRAME +box: 10 10 280 240 boxtype: FL_NO_BOX -colors: FL_COL1 FL_MCOL +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 +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast name: callback: argument: @@ -142,97 +88,97 @@ argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE -box: 120 20 160 30 +box: 94 15 191 30 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK -label: Class:|#C +label: Family:|#F shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_class -callback: ChoiceClassCB -argument: 0 +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: choice_family +callback: +argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE -box: 120 60 160 30 +box: 94 55 191 30 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK -label: Pagestyle:|#P +label: Series:|#S shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_pagestyle +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: choice_series callback: argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE -box: 120 110 160 30 +box: 94 95 191 30 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK -label: Fonts:|#F +label: Shape:|#H shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_fonts +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: choice_shape callback: argument: -------------------- class: FL_CHOICE type: NORMAL_CHOICE -box: 120 150 160 30 +box: 95 275 191 30 boxtype: FL_FRAME_BOX colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK -label: Font Size:|#O +label: Size:|#Z shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_fontsize +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: choice_size callback: argument: -------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 470 390 100 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER +class: FL_CHOICE +type: NORMAL_CHOICE +box: 95 335 190 30 +boxtype: FL_FRAME_BOX +colors: FL_COL1 FL_BLACK +alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK -label: Cancel|^[ +label: Misc:|#M shortcut: -resize: FL_RESIZE_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_cancel -callback: DocumentCancelCB -argument: 0 +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: choice_bar +callback: +argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 360 390 100 30 +box: 60 375 80 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -244,123 +190,129 @@ shortcut: resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast name: button_apply -callback: DocumentApplyCB +callback: CharacterApplyCB argument: 0 -------------------- class: FL_BUTTON type: RETURN_BUTTON -box: 250 390 100 30 +box: 175 375 80 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 +label: Close shortcut: ^M resize: FL_RESIZE_NONE gravity: FL_SouthEast FL_SouthEast -name: button_ok -callback: DocumentOKCB +name: button_close +callback: CharacterCloseCB argument: 0 -------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 450 195 120 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL +class: FL_CHOICE +type: NORMAL_CHOICE +box: 95 135 191 30 +boxtype: FL_FRAME_BOX +colors: FL_COL1 FL_BLACK alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK -label: Float Placement:|#L +label: Color:|#C shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: input_float_placement +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: choice_color callback: argument: -------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 120 230 190 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT +class: FL_CHECKBUTTON +type: PUSH_BUTTON +box: 30 215 255 25 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_YELLOW +alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE +size: FL_DEFAULT_SIZE lcol: FL_BLACK -label: PS Driver:|#S +label: Toggle on all these|#T shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_postscript_driver +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: check_toggle_all callback: argument: -------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 120 270 190 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE +class: FL_TEXT +type: NORMAL_TEXT +box: 20 255 210 20 +boxtype: FL_FLAT_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE +style: FL_BOLD_STYLE +size: FL_DEFAULT_SIZE lcol: FL_BLACK -label: Encoding:|#D +label: These are never toggled shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_inputenc +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: callback: argument: -------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 290 20 122 70 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_TOP_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE +class: FL_TEXT +type: NORMAL_TEXT +box: 20 315 215 20 +boxtype: FL_FLAT_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE +style: FL_BOLD_STYLE +size: FL_DEFAULT_SIZE lcol: FL_BLACK -label: +label: These are always toggled shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast name: callback: argument: -------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 432 20 136 70 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER +class: FL_CHOICE +type: DROPLIST_CHOICE +box: 95 175 190 30 +boxtype: FL_FRAME_BOX +colors: FL_COL1 FL_BLACK +alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK -label: +label: Language: shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: +resize: FL_RESIZE_X +gravity: FL_NorthWest FL_NorthEast +name: choice_language callback: argument: +=============== FORM =============== +Name: form_preamble +Width: 380 +Height: 420 +Number of Objects: 5 + -------------------- -class: FL_BEGIN_GROUP -type: 0 -box: 0 0 0 0 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_MCOL +class: FL_BOX +type: UP_BOX +box: 0 0 380 420 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE @@ -369,3441 +321,81 @@ label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity -name: group_radio_sides +name: callback: argument: -------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 290 30 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW +class: FL_BUTTON +type: NORMAL_BUTTON +box: 50 380 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: One|#n +label: OK|#O shortcut: resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: radio_sides_one -callback: -argument: +gravity: FL_SouthEast FL_SouthEast +name: button_ok +callback: PreambleOKCB +argument: 0 -------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 290 60 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW +class: FL_BUTTON +type: NORMAL_BUTTON +box: 160 380 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: Two|#T +label: Apply|#A shortcut: resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: radio_sides_two -callback: -argument: - --------------------- -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: 300 10 60 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Sides -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 440 10 80 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Columns -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest 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: group_radio_columns -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 432 30 110 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: One|#e -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: radio_columns_one -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 432 60 110 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Two|#w -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: radio_columns_two -callback: -argument: - --------------------- -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_INPUT -type: NORMAL_INPUT -box: 450 235 120 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Extra Options:|#X -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: input_extra -callback: -argument: - --------------------- -class: FL_BOX -type: FRAME_BOX -box: 120 190 190 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Language: -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_language -callback: -argument: - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 220 310 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: input_default_skip -callback: DocumentDefskipCB -argument: 0 - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 120 310 90 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Default Skip:|#u -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_default_skip -callback: DocumentDefskipCB -argument: 0 - --------------------- -class: FL_COUNTER -type: SIMPLE_COUNTER -box: 490 275 80 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_BLUE -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Section number depth -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: slider_secnumdepth -callback: -argument: - --------------------- -class: FL_COUNTER -type: SIMPLE_COUNTER -box: 490 315 80 30 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_BLUE -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Table of contents depth -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: slider_tocdepth -callback: -argument: - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 120 350 120 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Spacing|#g -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: choice_spacing -callback: DocumentSpacingCB +gravity: FL_SouthEast FL_SouthEast +name: button_apply +callback: PreambleApplyCB argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 430 110 130 30 +box: 270 380 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: Bullet Shapes|#B +label: Cancel|^[ shortcut: resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: button_bullets -callback: DocumentBulletsCB +gravity: FL_SouthEast FL_SouthEast +name: button_cancel +callback: PreambleCancelCB argument: 0 --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 430 145 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Use AMS Math|#M -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: check_use_amsmath -callback: -argument: - -------------------- class: FL_INPUT -type: FLOAT_INPUT -box: 250 350 95 30 +type: MULTILINE_INPUT +box: 10 10 360 360 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_NorthWest FL_NoGravity -name: input_spacing -callback: DocumentSpacingCB -argument: 0 - -=============== FORM =============== -Name: form_character -Width: 300 -Height: 415 -Number of Objects: 16 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 300 415 -boxtype: FL_UP_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE +size: FL_NORMAL_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NorthWest FL_SouthEast -name: -callback: -argument: - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 10 325 280 45 -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_X -gravity: FL_NorthWest FL_NorthEast -name: +name: input_preamble callback: argument: --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 10 265 280 45 -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_X -gravity: FL_NorthWest FL_NorthEast -name: -callback: -argument: - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 10 10 280 240 -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_X -gravity: FL_NorthWest FL_NorthEast -name: -callback: -argument: - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 94 15 191 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Family:|#F -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: choice_family -callback: -argument: - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 94 55 191 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Series:|#S -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: choice_series -callback: -argument: - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 94 95 191 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Shape:|#H -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: choice_shape -callback: -argument: - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 95 275 191 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Size:|#Z -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: choice_size -callback: -argument: - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 95 335 190 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Misc:|#M -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: choice_bar -callback: -argument: - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 60 375 80 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_apply -callback: CharacterApplyCB -argument: 0 - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 175 375 80 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: Close -shortcut: ^M -resize: FL_RESIZE_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_close -callback: CharacterCloseCB -argument: 0 - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 95 135 191 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Color:|#C -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: choice_color -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 30 215 255 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Toggle on all these|#T -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: check_toggle_all -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 20 255 210 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: These are never toggled -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 20 315 215 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: These are always toggled -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: -callback: -argument: - --------------------- -class: FL_CHOICE -type: DROPLIST_CHOICE -box: 95 175 190 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Language: -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NorthEast -name: choice_language -callback: -argument: - -=============== FORM =============== -Name: form_paragraph -Width: 490 -Height: 290 -Number of Objects: 33 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 490 290 -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: 127 250 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_ok -callback: ParagraphOKCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 244 250 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_apply -callback: ParagraphApplyCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 360 250 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_cancel -callback: ParagraphCancelCB -argument: 0 - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 360 110 120 50 -boxtype: FL_NO_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_FRAME -type: ENGRAVED_FRAME -box: 10 110 340 90 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_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: 360 20 120 70 -boxtype: FL_NO_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_FRAME -type: ENGRAVED_FRAME -box: 210 20 140 70 -boxtype: FL_NO_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_FRAME -type: ENGRAVED_FRAME -box: 10 20 190 70 -boxtype: FL_NO_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_INPUT -type: NORMAL_INPUT -box: 100 210 360 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Label Width:|#d -shortcut: -resize: FL_RESIZE_X -gravity: FL_West FL_East -name: input_labelwidth -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 370 100 60 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Indent -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 230 30 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Above|#b -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_lines_top -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 230 60 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Below|#E -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_lines_bottom -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 360 30 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Above|#o -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_pagebreaks_top -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 360 60 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Below|#l -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_pagebreaks_bottom -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 360 120 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: No Indent|#I -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_noindent -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: group_radio_alignment -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 10 30 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Right|#R -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_align_right -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 10 60 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Left|#f -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_align_left -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 100 30 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Block|#c -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_align_block -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 100 60 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Center|#n -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_align_center -callback: -argument: - --------------------- -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_INPUT -type: NORMAL_INPUT -box: 180 120 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_space_above -callback: ParagraphVSpaceCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 180 160 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_space_below -callback: ParagraphVSpaceCB -argument: 0 - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 70 120 100 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Above:|#v -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: choice_space_above -callback: ParagraphVSpaceCB -argument: 0 - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 70 160 100 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Below:|#w -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: choice_space_below -callback: ParagraphVSpaceCB -argument: 0 - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 370 10 100 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Pagebreaks -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 230 10 50 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Lines -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 20 10 80 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Alignment -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 20 100 130 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Vertical Spaces -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 10 250 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: ExtraOpt|#X -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_pextra -callback: ParagraphExtraOpen -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 270 120 40 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Keep|#K -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_space_above -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 270 160 40 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Keep|#p -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: check_space_below -callback: -argument: - -=============== FORM =============== -Name: form_preamble -Width: 380 -Height: 420 -Number of Objects: 5 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 380 420 -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: NORMAL_BUTTON -box: 50 380 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|#O -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_ok -callback: PreambleOKCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 160 380 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_apply -callback: PreambleApplyCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 270 380 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_cancel -callback: PreambleCancelCB -argument: 0 - --------------------- -class: FL_INPUT -type: MULTILINE_INPUT -box: 10 10 360 360 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NorthWest FL_SouthEast -name: input_preamble -callback: -argument: - -=============== FORM =============== -Name: form_quotes -Width: 340 -Height: 130 -Number of Objects: 10 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 340 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 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: -callback: QuotesOKCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 120 90 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: -callback: QuotesApplyCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 230 90 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: -callback: QuotesCancelCB -argument: 0 - --------------------- -class: FL_CHOICE -type: NORMAL_CHOICE -box: 90 10 160 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Type:|#T -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: choice_quotes_language -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: group_radio_quotes_number -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 90 50 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Single|#S -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_single -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 170 50 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Double|#D -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_double -callback: -argument: - --------------------- -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: 290 230 10 10 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Text -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - -=============== FORM =============== -Name: form_paper -Width: 440 -Height: 430 -Number of Objects: 31 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 440 430 -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_FRAME -type: ENGRAVED_FRAME -box: 230 100 200 100 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_TOP_LEFT -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: 290 20 140 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Special:|#S -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: choice_paperpackage -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 230 220 200 130 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_TOP_LEFT -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: 10 180 190 170 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_TOP_LEFT -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: 20 170 70 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Margins -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 240 210 160 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Foot/Head Margins -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 320 390 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: PaperCancelCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 210 390 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: PaperApplyCB -argument: 0 - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 100 390 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: PaperOKCB -argument: 0 - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 440 360 10 10 -boxtype: FL_NO_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_FRAME -type: ENGRAVED_FRAME -box: 440 350 10 10 -boxtype: FL_NO_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_FRAME -type: ENGRAVED_FRAME -box: 10 100 190 70 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_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: 20 90 95 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Orientation -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: greoup_radio_orientation -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 20 105 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Portrait|#o -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_portrait -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 20 135 120 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Landscape|#L -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_landscape -callback: -argument: - --------------------- -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_CHOICE -type: NORMAL_CHOICE -box: 70 20 160 30 -boxtype: FL_FRAME_BOX -colors: FL_COL1 FL_BLACK -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Papersize:|#P -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: choice_papersize2 -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 240 90 150 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Custom Papersize -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 20 55 170 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Use Geometry Package|#U -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: push_use_geometry -callback: -argument: - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 330 115 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Width:|#W -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_custom_width -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 330 155 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Height:|#H -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_custom_height -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 100 190 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Top:|#T -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_top_margin -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 100 230 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Bottom:|#B -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_bottom_margin -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 100 270 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Left:|#e -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_left_margin -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 100 310 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Right:|#R -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_right_margin -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 330 230 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Headheight:|#i -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_head_height -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 330 270 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Headsep:|#d -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_head_sep -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 330 310 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Footskip:|#F -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_foot_skip -callback: PaperMarginsCB -argument: 0 - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 10 360 420 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: text_warning -callback: -argument: - -=============== FORM =============== -Name: form_table_options -Width: 540 -Height: 310 -Number of Objects: 41 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 540 310 -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_FRAME -type: ENGRAVED_FRAME -box: 300 120 110 60 -boxtype: FL_NO_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_FRAME -type: ENGRAVED_FRAME -box: 300 20 110 90 -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_TEXT -type: NORMAL_TEXT -box: 20 275 330 30 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: text_warning -callback: -argument: - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 430 270 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: Close -shortcut: ^M -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_close -callback: TableOptCloseCB -argument: 0 - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 20 20 145 105 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_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: 30 10 70 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Borders -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 75 45 25 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_TOP_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Top|#T -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_border_top -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 75 75 25 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_BOTTOM_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Bottom|#B -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_border_bottom -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 55 60 25 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Left|#L -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_border_left -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 95 60 25 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_RIGHT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Right|#R -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_border_right -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 175 20 105 105 -boxtype: FL_NO_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_TEXT -type: NORMAL_TEXT -box: 180 10 90 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Alignment -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 300 10 100 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Special Cell -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 300 30 95 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Multicolumn|#M -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_multicolumn -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 10 170 120 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: Append Column|#A -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_append_column -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 140 170 120 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: Delete Column|#O -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_delete_column -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 10 200 120 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: Append Row|#p -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_append_row -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 140 200 120 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: Delete Row|#w -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_delete_row -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 10 240 250 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: Delete Table|#D -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_table_delete -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 290 240 60 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_TOP_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Column -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_table_column -callback: -argument: - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 360 240 60 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_TOP_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Row -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_table_row -callback: -argument: - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 10 140 120 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: Set Borders|#S -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_set_borders -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 140 140 120 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: Unset Borders|#U -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_unset_borders -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 300 130 90 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Longtable -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_longtable -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 330 190 95 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Width -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_column_width -callback: SetPWidthCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 300 155 90 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Rotate 90°|#9 -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_rotate_table -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 300 55 95 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Linebreaks|#N -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_linebreak_cell -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 300 110 100 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Spec. Table -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 420 20 100 160 -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_TEXT -type: NORMAL_TEXT -box: 425 10 85 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Longtable -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 420 30 90 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: First Head -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_lt_firsthead -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 420 60 90 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Head -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_lt_head -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 420 90 90 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Foot -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_lt_foot -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 420 120 90 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Last Foot -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_lt_lastfoot -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 420 150 90 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: New Page -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_lt_newpage -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 300 80 95 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE -lcol: FL_BLACK -label: Rotate 90° -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_rotate_cell -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 430 235 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: Extra|#X -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: button_table_extra -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 175 30 80 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Left|#e -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_align_left -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 175 55 80 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Right|#i -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_align_right -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 175 80 80 25 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Center|#C -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_align_center -callback: TableOptionsCB -argument: 0 - -=============== FORM =============== -Name: form_paragraph_extra -Width: 460 -Height: 250 -Number of Objects: 25 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 460 250 -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_FRAME -type: ENGRAVED_FRAME -box: 10 20 170 100 -boxtype: FL_NO_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_FRAME -type: ENGRAVED_FRAME -box: 350 20 100 100 -boxtype: FL_NO_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_FRAME -type: ENGRAVED_FRAME -box: 190 20 150 100 -boxtype: FL_NO_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_TEXT -type: NORMAL_TEXT -box: 20 10 120 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Extra Options -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 240 30 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Length|#L -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_pextra_width -callback: CheckPExtraOptCB -argument: 0 - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 130 210 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_ok -callback: ParagraphExtraOKCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 240 210 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_apply -callback: ParagraphExtraApplyCB -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 350 210 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_NONE -gravity: FL_SouthEast FL_SouthEast -name: button_cancel -callback: ParagraphExtraCancelCB -argument: 0 - --------------------- -class: FL_INPUT -type: INT_INPUT -box: 240 70 90 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: or %|#o -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: input_pextra_widthp -callback: CheckPExtraOptCB -argument: 0 - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 200 10 60 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Width -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 350 10 90 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Alignment -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: group_alignment -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 360 30 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Top|#T -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_pextra_top -callback: CheckPExtraOptCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 360 60 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Middle|#d -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_pextra_middle -callback: CheckPExtraOptCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: RADIO_BUTTON -box: 360 90 80 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Bottom|#B -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_pextra_bottom -callback: CheckPExtraOptCB -argument: 0 - --------------------- -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: 10 170 330 30 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: text_warning -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 10 130 300 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: HFill between Minipage paragraphs|#H -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_pextra_hfill -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 10 160 260 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Start new Minipage|#S -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_pextra_startmp -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: group_extraopt -callback: -argument: - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 10 30 160 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Indented Paragraph|#I -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_pextra_indent -callback: CheckPExtraOptCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 10 60 160 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Minipage|#M -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_pextra_minipage -callback: CheckPExtraOptCB -argument: 0 - --------------------- -class: FL_CHECKBUTTON -type: PUSH_BUTTON -box: 10 90 160 30 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_YELLOW -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Floatflt|#F -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: radio_pextra_floatflt -callback: CheckPExtraOptCB -argument: 0 - --------------------- -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: - -=============== FORM =============== -Name: form_table_extra -Width: 330 -Height: 200 -Number of Objects: 8 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 330 200 -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_FRAME -type: ENGRAVED_FRAME -box: 15 95 305 60 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 20 85 205 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Special Multicolumn Alignment -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_FRAME -type: ENGRAVED_FRAME -box: 15 20 305 60 -boxtype: FL_NO_BOX -colors: FL_COL1 FL_COL1 -alignment: FL_ALIGN_CENTER -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 25 35 280 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NoGravity -name: input_special_alignment -callback: TableOptionsCB -argument: 0 - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 220 160 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: Close -shortcut: ^M -resize: FL_RESIZE_NONE -gravity: FL_SouthEast FL_SouthEast -name: -callback: TableSpeCloseCB -argument: 0 - --------------------- -class: FL_TEXT -type: NORMAL_TEXT -box: 20 10 170 20 -boxtype: FL_FLAT_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE -style: FL_BOLD_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: Special Column Alignment -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NoGravity -name: -callback: -argument: - --------------------- -class: FL_INPUT -type: NORMAL_INPUT -box: 25 110 280 30 -boxtype: FL_DOWN_BOX -colors: FL_COL1 FL_MCOL -alignment: FL_ALIGN_LEFT -style: FL_NORMAL_STYLE -size: FL_NORMAL_SIZE -lcol: FL_BLACK -label: -shortcut: -resize: FL_RESIZE_X -gravity: FL_NorthWest FL_NoGravity -name: input_special_multialign -callback: TableOptionsCB -argument: 0 - ============================== create_the_forms diff --git a/forms/layout_forms.h.patch b/forms/layout_forms.h.patch index 66f07514af..ba4cb7519a 100644 --- a/forms/layout_forms.h.patch +++ b/forms/layout_forms.h.patch @@ -1,49 +1,22 @@ ---- layout_forms.h.orig Sat Jun 10 01:48:56 2000 -+++ layout_forms.h Sat Jun 10 02:10:12 2000 -@@ -3,6 +3,8 @@ - #ifndef FD_form_document_h_ - #define FD_form_document_h_ - -+extern "C" { -+ - /** Callbacks, globals and object handlers **/ - extern void ChoiceClassCB(FL_OBJECT *, long); - extern void DocumentCancelCB(FL_OBJECT *, long); -@@ -46,6 +48,29 @@ - extern void TableOptionsCB(FL_OBJECT *, long); - extern void TableSpeCloseCB(FL_OBJECT *, long); - -+} -+ -+/* Additional Functions/Methods */ -+ -+#include "bufferparams.h" -+ -+extern bool UpdateLayoutDocument(BufferParams *params = NULL); -+extern bool UpdateLayoutPreamble(); -+extern bool UpdateLayoutPaper(); -+extern bool UpdateLayoutQuotes(); -+extern bool UpdateLayoutParagraph(); -+extern bool UpdateParagraphExtra(); -+extern bool UpdateLayoutTable(int); -+ -+extern void MenuLayoutCharacter(); -+extern void MenuLayoutDocument(); -+extern void MenuLayoutPreamble(); -+extern void MenuLayoutPaper(); -+extern void MenuLayoutQuotes(); -+extern void MenuLayoutParagraph(); -+extern void MenuLayoutTable(int); -+ -+extern "C" { - - /**** Forms and Objects ****/ - typedef struct { -@@ -255,5 +280,7 @@ - } FD_form_table_extra; - - extern FD_form_table_extra * create_form_form_table_extra(void); -+ -+} - - #endif /* FD_form_document_h_ */ +1c1 +< /** Header file generated with fdesign on Tue Sep 26 15:14:15 2000.**/ +--- +> /** Header file generated with fdesign **/ +7,8c7,8 +< extern void CharacterApplyCB(FL_OBJECT *, long); +< extern void CharacterCloseCB(FL_OBJECT *, long); +--- +> extern "C" void CharacterApplyCB(FL_OBJECT *, long); +> extern "C" void CharacterCloseCB(FL_OBJECT *, long); +10,12c10,12 +< extern void PreambleOKCB(FL_OBJECT *, long); +< extern void PreambleApplyCB(FL_OBJECT *, long); +< extern void PreambleCancelCB(FL_OBJECT *, long); +--- +> extern "C" void PreambleOKCB(FL_OBJECT *, long); +> extern "C" void PreambleApplyCB(FL_OBJECT *, long); +> extern "C" void PreambleCancelCB(FL_OBJECT *, long); +13a14,16 +> /* Some extra funcs */ +> +> extern bool UpdateLayoutPreamble(); diff --git a/forms/makefile b/forms/makefile index d8f6feba80..52ba88a9ba 100644 --- a/forms/makefile +++ b/forms/makefile @@ -17,15 +17,15 @@ SHELL = /bin/sh # Various commands FDESIGN = fdesign -SRCS = bullet_forms.fd credits_form.fd form1.fd \ +SRCS = credits_form.fd form1.fd \ log_form.fd layout_forms.fd lyx.fd lyx_sendfax.fd math_forms.fd \ print_form.fd sp_form.fd -OBJS = bullet_forms.c credits_form.c form1.c \ +OBJS = credits_form.c form1.c \ log_form.c layout_forms.c lyx.c lyx_sendfax.c math_forms.c \ print_form.c sp_form.c -COBJS = bullet_forms.C credits_form.C form1.C \ +COBJS = credits_form.C form1.C \ log_form.C layout_forms.C lyx.C lyx_sendfax.C math_forms.C \ print_form.C sp_form.C @@ -52,7 +52,7 @@ e: c for hfil in *.h ; do \ if [ -f "$$hfil.patch" ] ; then \ (echo "Patching $$hfil with $$hfil.patch" ; \ - patch -s $$hfil < $$hfil.patch) \ + patch --verbose $$hfil < $$hfil.patch) \ fi; \ sed < $$hfil > $$hfil.tmp \ -e 's/\(extern\) \(void.*FL_OBJECT\)/\1 "C" \2/' \ @@ -68,9 +68,9 @@ updatesrc: d e @echo "get junk code and errors at compile time.">&2 for fil in *.C *.h ; do \ if [ $$fil = "math_forms.C" -o $$fil = "math_forms.h" ]; then \ - cp $$fil ../src/mathed ; \ + cmp -s $$fil ../src/mathed/$$fil || cp $$fil ../src/mathed ; \ else \ - cp $$fil ../src ; \ + cmp -s $$fil ../src/$$fil || cp $$fil ../src ; \ fi \ done diff --git a/po/POTFILES.in b/po/POTFILES.in index 97bca017d1..71ea86201a 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -14,8 +14,6 @@ src/bufferlist.C src/BufferView2.C src/bufferview_funcs.C src/BufferView_pimpl.C -src/bullet_forms.C -src/bullet_forms_cb.C src/Chktex.C src/ColorHandler.C src/combox.C @@ -127,9 +125,7 @@ src/mathed/math_forms.C src/mathed/math_panel.C src/MenuBackend.C src/minibuffer.C -src/PaperLayout.C src/paragraph.C -src/ParagraphExtra.C src/print_form.C src/spellchecker.C src/sp_form.C diff --git a/src/BufferView2.C b/src/BufferView2.C index 55e1a8a335..fd8615a134 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -716,13 +716,13 @@ void BufferView::replaceWord(string const & replacestring) /* clear the selection (if there is any) */ toggleSelection(false); - text->ReplaceSelectionWithString(this, replacestring.c_str()); + text->ReplaceSelectionWithString(this, replacestring); - text->SetSelectionOverString(this, replacestring.c_str()); + text->SetSelectionOverString(this, replacestring); // Go back so that replacement string is also spellchecked for (string::size_type i = 0; i < replacestring.length() + 1; ++i) { - text->CursorLeftIntern(this); + text->CursorLeft(this); } update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); } diff --git a/src/Chktex.C b/src/Chktex.C index 87a8c18972..8e315bd9bd 100644 --- a/src/Chktex.C +++ b/src/Chktex.C @@ -14,7 +14,6 @@ #include #include -#include // atoi #ifdef __GNUG__ #pragma implementation @@ -76,7 +75,7 @@ int Chktex::scanLogFile(TeXErrors & terr) token = split(token, warno, ':'); token = split(token, warning, ':'); - int lineno = atoi(line.c_str()); + int lineno = lyx::atoi(line); warno = _("ChkTeX warning id #") + warno; terr.insertError(lineno, warno, warning); ++retval; diff --git a/src/DepTable.C b/src/DepTable.C index 1b8f32a1d6..8af0420aaf 100644 --- a/src/DepTable.C +++ b/src/DepTable.C @@ -37,7 +37,7 @@ void DepTable::insert(string const & fi, if (deplist.find(f) == deplist.end()) { if (upd) { one = two; - two = lyx::sum(f.c_str()); + two = lyx::sum(f); } deplist[f] = make_pair(one, two); } @@ -49,8 +49,8 @@ void DepTable::update() for(DepList::iterator itr = deplist.begin(); itr != deplist.end(); ++itr) { - unsigned long one = (*itr).second.second; - unsigned long two = lyx::sum((*itr).first.c_str()); + unsigned long const one = (*itr).second.second; + unsigned long const two = lyx::sum((*itr).first); (*itr).second = make_pair(one, two); if (lyxerr.debugging(Debug::DEPEND)) { lyxerr << "Update dep: " << (*itr).first << " " @@ -93,7 +93,7 @@ bool DepTable::extchanged(string const & ext) const for (DepList::const_iterator cit = deplist.begin(); cit != deplist.end(); ++cit) { - if (suffixIs((*cit).first, ext.c_str())) { + if (suffixIs((*cit).first, ext)) { if ((*cit).second.first != (*cit).second.second) return true; } @@ -115,7 +115,7 @@ void DepTable::remove_files_with_extension(string const & suf) DepList tmp; for (DepList::const_iterator cit = deplist.begin(); cit != deplist.end(); ++cit) { - if (!suffixIs((*cit).first, suf.c_str())) + if (!suffixIs((*cit).first, suf)) tmp[(*cit).first] = (*cit).second; } deplist.swap(tmp); @@ -126,8 +126,7 @@ void DepTable::write(string const & f) const { ofstream ofs(f.c_str()); for (DepList::const_iterator cit = deplist.begin(); - cit != deplist.end(); - ++cit) { + cit != deplist.end(); ++cit) { if (lyxerr.debugging(Debug::DEPEND)) { lyxerr << "Write dep: " << (*cit).first << " " diff --git a/src/FontInfo.C b/src/FontInfo.C index 1ccb10816f..95a936142f 100644 --- a/src/FontInfo.C +++ b/src/FontInfo.C @@ -11,7 +11,6 @@ #include #include // fabs() -#include // atoi() #include FORMS_H_LOCATION @@ -131,7 +130,7 @@ void FontInfo::query() // We have matches. Run them through for(int i = 0; i < matches; ++i) { string name(list[i]); - sizes[i] = atoi(token(name, '-', 7).c_str()); + sizes[i] = lyx::atoi(token(name, '-', 7)); strings[i] = name; if (sizes[i] == 0) { if (scaleindex == -1) { diff --git a/src/FontLoader.C b/src/FontLoader.C index 6938348f6e..0785ba31bb 100644 --- a/src/FontLoader.C +++ b/src/FontLoader.C @@ -11,7 +11,6 @@ #include #include // fabs() -#include // atoi() #ifdef __GNUG__ #pragma implementation "FontLoader.h" diff --git a/src/LaTeX.C b/src/LaTeX.C index 36de5a4b0c..15a60ed299 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -83,7 +83,7 @@ void LaTeX::deleteFilesOnError() const // What files do we have to delete? // This will at least make latex do all the runs - ::unlink(depfile.c_str()); + lyx::unlink(depfile); // but the reason for the error might be in a generated file... @@ -91,15 +91,15 @@ void LaTeX::deleteFilesOnError() const // bibtex file string bbl = ChangeExtension(ofname, ".bbl"); - ::unlink(bbl.c_str()); + lyx::unlink(bbl); // makeindex file string ind = ChangeExtension(ofname, ".ind"); - ::unlink(ind.c_str()); + lyx::unlink(ind); // Also remove the aux file string aux = ChangeExtension(ofname, ".aux"); - ::unlink(aux.c_str()); + lyx::unlink(aux); } diff --git a/src/LyXAction.C b/src/LyXAction.C index 5347503888..c081a0eb1a 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -22,11 +22,6 @@ // only to get access to NEW_INSETS #include "lyxparagraph.h" #endif -#if 1 -// only to get access to NEW_EXPORT -#include "exporter.h" -#endif - using std::ostream; using std::endl; @@ -137,8 +132,6 @@ void LyXAction::init() #endif { LFUN_IMPORT, "buffer-import", N_("Import document"), NoBuffer }, - { LFUN_BUFFERBULLETSSELECT, "buffer-itemize-bullets-select", - "", Noop }, { LFUN_BUFFER_PRINT, "buffer-print-xtl", N_("Print"), ReadOnly }, { LFUN_PRINTER_PARAMS_GET, "printer-params-get", @@ -154,18 +147,8 @@ void LyXAction::init() N_("Switch to an open document"), ReadOnly }, { LFUN_READ_ONLY_TOGGLE, "buffer-toggle-read-only", N_("Toggle read-only"), ReadOnly }, -#ifdef NEW_EXPORT { LFUN_UPDATE, "buffer-update", N_("Update"), ReadOnly }, { LFUN_PREVIEW, "buffer-view", N_("View") , ReadOnly }, -#else - { LFUN_RUNLATEX, "buffer-typeset", N_("Update DVI"), - ReadOnly }, - { LFUN_RUNDVIPS, "buffer-typeset-ps", - N_("Update PostScript"), ReadOnly }, - { LFUN_PREVIEW, "buffer-view", N_("View DVI") , ReadOnly }, - { LFUN_PREVIEWPS, "buffer-view-ps", - N_("View PostScript") , ReadOnly }, -#endif { LFUN_MENUWRITE, "buffer-write", N_("Save"), ReadOnly }, { LFUN_MENUWRITEAS, "buffer-write-as", N_("Save As"), ReadOnly }, @@ -283,15 +266,11 @@ void LyXAction::init() { LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly }, { LFUN_LAYOUTNO, "layout-number", "", Noop }, // internal only { LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly }, - { LFUN_LAYOUT_PAPER, "layout-paper", "", ReadOnly }, { LFUN_LAYOUT_PASTE, "layout-paste", N_("Paste paragraph environment type"), Noop }, { LFUN_LAYOUT_PREAMBLE, "layout-preamble", "", ReadOnly }, - { LFUN_LAYOUT_QUOTES, "layout-quotes", "", ReadOnly }, { LFUN_LAYOUT_SAVE_DEFAULT, "layout-save-default", "", ReadOnly }, - { LFUN_LAYOUT_TABLE, "layout-table", - N_("Open the table layout"), Noop }, { LFUN_LAYOUT_TABULAR, "layout-tabular", N_("Open the tabular layout"), Noop }, { LFUN_HOME, "line-begin", @@ -547,7 +526,6 @@ kb_action LyXAction::retrieveActionArg(int pseudo, string & arg) const lyxerr << "Lyx Error: Unrecognized pseudo-action\n"; return LFUN_UNKNOWN_ACTION; } - } diff --git a/src/LyXSendto.C b/src/LyXSendto.C index 1c007a81a3..5e7587c35d 100644 --- a/src/LyXSendto.C +++ b/src/LyXSendto.C @@ -11,7 +11,6 @@ #include "lyx_gui_misc.h" #include "support/syscall.h" #include "gettext.h" -//#include "lyx_cb.h" #include "bufferview_funcs.h" #include "exporter.h" @@ -57,18 +56,6 @@ void SendtoApplyCB(FL_OBJECT *, long) if (command.empty()) return; Buffer * buffer = current_view->buffer(); -#ifndef NEW_EXPORT - if (fl_get_button(fd_form_sendto->radio_ftype_dvi) || - fl_get_button(fd_form_sendto->radio_ftype_ps)) { - ProhibitInput(current_view); - // Generate dvi file and check if there are errors in the .lyx file - if (MakeLaTeXOutput(buffer) > 0) { - AllowInput(current_view); - return; - } - AllowInput(current_view); - } -#endif string ftypeext; if (fl_get_button(fd_form_sendto->radio_ftype_lyx)) ftypeext = ".lyx"; @@ -79,20 +66,13 @@ void SendtoApplyCB(FL_OBJECT *, long) else if (fl_get_button(fd_form_sendto->radio_ftype_ascii)) ftypeext = ".txt"; else { -#ifdef NEW_EXPORT ftypeext = ".ps"; if (!Exporter::Export(buffer, "ps", true)) return; -#else - ftypeext = ".ps_tmp"; - if (!CreatePostscript(buffer, true)) { - return; - } -#endif } - string fname = OnlyFilename(ChangeExtension(buffer->getLatexName(), - ftypeext)); + string const fname = OnlyFilename(ChangeExtension(buffer->getLatexName(), + ftypeext)); if (!contains(command, "$$FName")) command = "( " + command + " ) <$$FName"; command = subst(command, "$$FName", fname); diff --git a/src/LyXView.C b/src/LyXView.C index ecba3b8bb8..92655d1430 100644 --- a/src/LyXView.C +++ b/src/LyXView.C @@ -40,8 +40,6 @@ using std::endl; -extern FD_form_document * fd_form_document; - extern void AutoSave(BufferView *); extern void QuitLyX(); LyXTextClass::size_type current_layout = 0; @@ -311,7 +309,6 @@ void LyXView::init() // Set the textclass choice invalidateLayoutChoice(); updateLayoutChoice(); - UpdateDocumentClassChoice(); updateMenubar(); // Start autosave timer @@ -365,20 +362,6 @@ void LyXView::updateLayoutChoice() } -void LyXView::UpdateDocumentClassChoice() -{ - // Update the document class display in the document form - if (fd_form_document) { - fl_clear_choice(fd_form_document->choice_class); - for (LyXTextClassList::const_iterator cit = textclasslist.begin(); - cit != textclasslist.end(); ++cit) { - fl_addto_choice(fd_form_document->choice_class, - (*cit).description().c_str()); - } - } -} - - #if 0 // This is necessary, since FL_FREE-Objects doesn't get all keypress events // as FL_KEYBOARD events :-( Matthias 280596 diff --git a/src/LyXView.h b/src/LyXView.h index af420cad92..7e994aeb43 100644 --- a/src/LyXView.h +++ b/src/LyXView.h @@ -131,10 +131,8 @@ private: BufferView * bufferview; /// void invalidateLayoutChoice(); - /// - void UpdateDocumentClassChoice(); public: -#if FL_REVISION < 89 +#if 0 /// static int KeyPressMask_raw_callback(FL_FORM *, void * xev); #endif diff --git a/src/Makefile.am b/src/Makefile.am index 419fdb1986..7bc192a80a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,8 +69,6 @@ lyx_SOURCES = \ Painter.h \ PainterBase.C \ PainterBase.h \ - PaperLayout.C \ - ParagraphExtra.C \ PrinterParams.h \ Sectioning.h \ Sectioning.C \ @@ -100,9 +98,6 @@ lyx_SOURCES = \ bufferparams.h \ bufferview_funcs.C \ bufferview_funcs.h \ - bullet_forms.C \ - bullet_forms.h \ - bullet_forms_cb.C \ chset.C \ chset.h \ combox.C \ diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 6e6b2c7282..896100436b 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -116,7 +116,7 @@ Menu & Menu::read(LyXLex & lex) // fallback to md_item case md_item: { lex.next(); - char * tmp = strdup(lex.GetString().c_str()); + char * tmp = ::strdup(lex.GetString().c_str()); string name = _(tmp); free(tmp); lex.next(); @@ -161,7 +161,7 @@ Menu & Menu::read(LyXLex & lex) case md_submenu: { lex.next(); - char * tmp = strdup(lex.GetString().c_str()); + char * tmp = ::strdup(lex.GetString().c_str()); string mlabel = _(tmp); free(tmp); lex.next(); diff --git a/src/PaperLayout.C b/src/PaperLayout.C deleted file mode 100644 index c9c807ef1b..0000000000 --- a/src/PaperLayout.C +++ /dev/null @@ -1,282 +0,0 @@ -#include - -#include - -#include FORMS_H_LOCATION -#include "layout_forms.h" -#include "lyx_main.h" -#include "lyxrc.h" -#include "LString.h" -#include "support/filetools.h" -#include "buffer.h" -#include "minibuffer.h" -#include "vspace.h" -#include "lyx_gui_misc.h" -#include "BufferView.h" -#include "gettext.h" -#include "LyXView.h" - -extern FD_form_paper * fd_form_paper; -extern BufferView * current_view; - - -inline -void DeactivatePaperButtons () -{ - fl_deactivate_object (fd_form_paper->button_ok); - fl_deactivate_object (fd_form_paper->button_apply); - fl_set_object_lcol (fd_form_paper->button_ok, FL_INACTIVE); - fl_set_object_lcol (fd_form_paper->button_apply, FL_INACTIVE); -} - - -inline -void ActivatePaperButtons () -{ - fl_activate_object (fd_form_paper->button_ok); - fl_activate_object (fd_form_paper->button_apply); - fl_set_object_lcol (fd_form_paper->button_ok, FL_BLACK); - fl_set_object_lcol (fd_form_paper->button_apply, FL_BLACK); -} - - -inline -void DisablePaperLayout() -{ - DeactivatePaperButtons(); - fl_deactivate_object (fd_form_paper->choice_paperpackage); - fl_deactivate_object (fd_form_paper->greoup_radio_orientation); - fl_deactivate_object (fd_form_paper->radio_portrait); - fl_deactivate_object (fd_form_paper->radio_landscape); - fl_deactivate_object (fd_form_paper->choice_papersize2); - fl_deactivate_object (fd_form_paper->push_use_geometry); - fl_deactivate_object (fd_form_paper->input_custom_width); - fl_deactivate_object (fd_form_paper->input_custom_height); - fl_deactivate_object (fd_form_paper->input_top_margin); - fl_deactivate_object (fd_form_paper->input_bottom_margin); - fl_deactivate_object (fd_form_paper->input_left_margin); - fl_deactivate_object (fd_form_paper->input_right_margin); - fl_deactivate_object (fd_form_paper->input_head_height); - fl_deactivate_object (fd_form_paper->input_head_sep); - fl_deactivate_object (fd_form_paper->input_foot_skip); - fl_deactivate_object (fd_form_paper->text_warning); -} - - -inline -void EnablePaperLayout() -{ - ActivatePaperButtons(); - fl_activate_object (fd_form_paper->choice_paperpackage); - fl_activate_object (fd_form_paper->greoup_radio_orientation); - fl_activate_object (fd_form_paper->radio_portrait); - fl_activate_object (fd_form_paper->radio_landscape); - fl_activate_object (fd_form_paper->choice_papersize2); - fl_activate_object (fd_form_paper->push_use_geometry); - fl_activate_object (fd_form_paper->input_custom_width); - fl_activate_object (fd_form_paper->input_custom_height); - fl_activate_object (fd_form_paper->input_top_margin); - fl_activate_object (fd_form_paper->input_bottom_margin); - fl_activate_object (fd_form_paper->input_left_margin); - fl_activate_object (fd_form_paper->input_right_margin); - fl_activate_object (fd_form_paper->input_head_height); - fl_activate_object (fd_form_paper->input_head_sep); - fl_activate_object (fd_form_paper->input_foot_skip); - fl_activate_object (fd_form_paper->text_warning); -} - - -static -void checkMarginValues() -{ - int allEmpty; - - fl_hide_object(fd_form_paper->text_warning); - ActivatePaperButtons(); - - allEmpty = (!strlen(fl_get_input(fd_form_paper->input_top_margin)) && - !strlen(fl_get_input(fd_form_paper->input_bottom_margin)) && - !strlen(fl_get_input(fd_form_paper->input_left_margin)) && - !strlen(fl_get_input(fd_form_paper->input_right_margin)) && - !strlen(fl_get_input(fd_form_paper->input_head_height)) && - !strlen(fl_get_input(fd_form_paper->input_head_sep)) && - !strlen(fl_get_input(fd_form_paper->input_foot_skip)) && - !strlen(fl_get_input(fd_form_paper->input_custom_width)) && - !strlen(fl_get_input(fd_form_paper->input_custom_height))); - if (!allEmpty) { - fl_set_button(fd_form_paper->push_use_geometry, 1); - } -} - - -bool UpdateLayoutPaper() -{ - bool update = true; - if (!current_view->available()) - update = false; - - if (update) { - BufferParams * params = ¤t_view->buffer()->params; - - fl_set_choice(fd_form_paper->choice_papersize2, - params->papersize2 + 1); - fl_set_choice(fd_form_paper->choice_paperpackage, - params->paperpackage + 1); - fl_set_button(fd_form_paper->push_use_geometry, - params->use_geometry); - fl_set_button(fd_form_paper->radio_portrait, 0); - fl_set_button(fd_form_paper->radio_landscape, 0); - if (params->orientation == BufferParams::ORIENTATION_LANDSCAPE) - fl_set_button(fd_form_paper->radio_landscape, 1); - else - fl_set_button(fd_form_paper->radio_portrait, 1); - - fl_set_input(fd_form_paper->input_custom_width, - params->paperwidth.c_str()); - fl_set_input(fd_form_paper->input_custom_height, - params->paperheight.c_str()); - fl_set_input(fd_form_paper->input_left_margin, - params->leftmargin.c_str()); - fl_set_input(fd_form_paper->input_top_margin, - params->topmargin.c_str()); - fl_set_input(fd_form_paper->input_right_margin, - params->rightmargin.c_str()); - fl_set_input(fd_form_paper->input_bottom_margin, - params->bottommargin.c_str()); - fl_set_input(fd_form_paper->input_head_height, - params->headheight.c_str()); - fl_set_input(fd_form_paper->input_head_sep, - params->headsep.c_str()); - fl_set_input(fd_form_paper->input_foot_skip, - params->footskip.c_str()); - fl_set_focus_object(fd_form_paper->form_paper, - fd_form_paper->choice_papersize2); - fl_hide_object(fd_form_paper->text_warning); - if (current_view->buffer()->isReadonly()) { - DisablePaperLayout(); - fl_set_object_label(fd_form_paper->text_warning, - _("Document is read-only." - " No changes to layout" - " permitted.")); - fl_show_object(fd_form_paper->text_warning); - } else { - EnablePaperLayout(); - } - } else if (fd_form_paper->form_paper->visible) { - fl_hide_form(fd_form_paper->form_paper); - } - return update; -} - - -void MenuLayoutPaper() -{ - if (UpdateLayoutPaper()) { - if (fd_form_paper->form_paper->visible) { - fl_raise_form(fd_form_paper->form_paper); - } else { - fl_show_form(fd_form_paper->form_paper, - FL_PLACE_MOUSE, FL_FULLBORDER, - _("Paper Layout")); - } - } -} - - -void PaperApplyCB(FL_OBJECT *, long) -{ - if (!current_view->available()) - return; - - BufferParams * params = ¤t_view->buffer()->params; - - FD_form_paper const * fd = fd_form_paper; - - params->papersize2 = fl_get_choice(fd->choice_papersize2)-1; - params->paperpackage = fl_get_choice(fd->choice_paperpackage)-1; - params->use_geometry = fl_get_button(fd_form_paper->push_use_geometry); - if (fl_get_button(fd_form_paper->radio_landscape)) - params->orientation = BufferParams::ORIENTATION_LANDSCAPE; - else - params->orientation = BufferParams::ORIENTATION_PORTRAIT; - params->paperwidth = fl_get_input(fd->input_custom_width); - params->paperheight = fl_get_input(fd->input_custom_height); - params->leftmargin = fl_get_input(fd->input_left_margin); - params->topmargin = fl_get_input(fd->input_top_margin); - params->rightmargin = fl_get_input(fd->input_right_margin); - params->bottommargin = fl_get_input(fd->input_bottom_margin); - params->headheight = fl_get_input(fd->input_head_height); - params->headsep = fl_get_input(fd->input_head_sep); - params->footskip = fl_get_input(fd->input_foot_skip); - current_view->buffer()->setPaperStuff(); - current_view->owner()->getMiniBuffer()->Set(_("Paper layout set")); - current_view->buffer()->markDirty(); - - return; -} - - -void PaperCancelCB(FL_OBJECT *, long) -{ - fl_hide_form(fd_form_paper->form_paper); -} - - -void PaperOKCB(FL_OBJECT * ob, long data) -{ - PaperCancelCB(ob, data); - PaperApplyCB(ob, data); -} - - -void PaperMarginsCB(FL_OBJECT * ob, long) -{ - FD_form_paper const * fd = fd_form_paper; - string str; - char val; - - checkMarginValues(); - if (ob == fd->choice_papersize2) { - val = fl_get_choice(fd->choice_papersize2)-1; - if (val == BufferParams::VM_PAPER_DEFAULT) { - fl_set_button(fd->push_use_geometry, 0); - checkMarginValues(); - } else { - if (val != BufferParams::VM_PAPER_USLETTER - && val != BufferParams::VM_PAPER_USLEGAL - && val != BufferParams::VM_PAPER_USEXECUTIVE - && val != BufferParams::VM_PAPER_A4 - && val != BufferParams::VM_PAPER_A5 - && val != BufferParams::VM_PAPER_B5) { - fl_set_button(fd->push_use_geometry, 1); - } - fl_set_choice(fd->choice_paperpackage, BufferParams::PACKAGE_NONE + 1); - } - } else if (ob == fd->choice_paperpackage) { - val = fl_get_choice(fd->choice_paperpackage)-1; - if (val != BufferParams::PACKAGE_NONE) { - fl_set_choice(fd->choice_papersize2, - BufferParams::VM_PAPER_DEFAULT + 1); - fl_set_button(fd->push_use_geometry, 0); - } - } else if (ob == fd->input_custom_width - || ob == fd->input_custom_height - || ob == fd->input_left_margin - || ob == fd->input_right_margin - || ob == fd->input_top_margin - || ob == fd->input_bottom_margin - || ob == fd->input_head_height - || ob == fd->input_head_sep - || ob == fd->input_foot_skip) { - str = fl_get_input(ob); - if (!str.empty() && !isValidLength(str)) { - fl_set_object_label(fd_form_paper->text_warning, - _("Warning: Invalid Length" - " (valid example: 10mm)")); - fl_show_object(fd_form_paper->text_warning); - DeactivatePaperButtons(); - } else if (!str.empty()) - fl_set_button(fd->push_use_geometry, 1); - } - return; -} diff --git a/src/ParagraphExtra.C b/src/ParagraphExtra.C deleted file mode 100644 index b2d2a97d6a..0000000000 --- a/src/ParagraphExtra.C +++ /dev/null @@ -1,320 +0,0 @@ -#include - -#include -#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; -} diff --git a/src/PrinterParams.h b/src/PrinterParams.h index 90ce2f9a00..670c32ae22 100644 --- a/src/PrinterParams.h +++ b/src/PrinterParams.h @@ -21,8 +21,10 @@ #ifdef ENABLE_ASSERTIONS #include "support/LAssert.h" +extern bool containsOnly(string const &, char const *); #endif + /** This struct contains (or should contain) all the parameters required for printing a buffer. Some work still needs to be done on this struct and @@ -33,7 +35,7 @@ */ struct PrinterParams { /// - enum Target{ + enum Target { /// PRINTER, /// @@ -131,7 +133,6 @@ struct PrinterParams { void testInvariant() const { #ifdef ENABLE_ASSERTIONS - extern bool containsOnly(string const &, char const *); if (!from_page.empty()) { // Assert(from_page == number or empty) Assert(containsOnly(from_page, "1234567890")); @@ -166,6 +167,3 @@ struct PrinterParams { }; #endif - - - diff --git a/src/buffer.C b/src/buffer.C index 37b16e5bda..7f3372b60b 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -109,9 +109,6 @@ using std::istringstream; // all these externs should eventually be removed. extern BufferList bufferlist; -#ifndef NEW_EXPORT -extern void MenuExport(Buffer *, string const &); -#endif extern LyXAction lyxaction; @@ -189,9 +186,9 @@ void Buffer::setReadonly(bool flag) } -bool Buffer::saveParamsAsDefaults() +bool Buffer::saveParamsAsDefaults() // const { - string fname = AddName(AddPath(user_lyxdir, "templates/"), + string const fname = AddName(AddPath(user_lyxdir, "templates/"), "defaults.lyx"); Buffer defaults = Buffer(fname); @@ -240,7 +237,6 @@ void Buffer::fileName(string const & newfile) // Returns false if "\the_end" is not read for formats >= 2.13. (Asger) bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par) { - string tmptok; int pos = 0; char depth = 0; // signed or unsigned? #ifndef NEW_INSETS @@ -285,19 +281,17 @@ bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par) pretoken = lex.GetString(); } - // Profiling show this should give a lot: (Asger) - string const token = pretoken; - - if (token.empty()) - continue; - the_end_read = parseSingleLyXformat2Token(lex, par, return_par, - token, pos, depth, - font + if (pretoken.empty()) continue; + + the_end_read = + parseSingleLyXformat2Token(lex, par, return_par, + pretoken, pos, depth, + font #ifndef NEW_INSETS - , footnoteflag, - footnotekind + , footnoteflag, + footnotekind #endif - ); + ); } if (!return_par) @@ -346,7 +340,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, } pos = 0; lex.EatLine(); - string layoutname = lex.GetString(); + string const layoutname = lex.GetString(); pair pp = textclasslist.NumberOfLayout(params.textclass, layoutname); @@ -403,7 +397,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, // This is the compability reader, unfinished but tested. // (Lgb) lex.next(); - string tmptok = lex.GetString(); + string const tmptok = lex.GetString(); //lyxerr << "old float: " << tmptok << endl; Inset * inset = 0; @@ -443,7 +437,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, // This _is_ a hack! (Lgb) while(true) { lex.next(); - string tmp = lex.GetString(); + string const tmp = lex.GetString(); if (tmp == "\\end_deeper") { lyxerr << "\\end_deeper caught!" << endl; if (!depth) { @@ -657,7 +651,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, params.pagestyle = strip(lex.GetString()); } else if (token == "\\bullet") { lex.nextToken(); - int index = lex.GetInteger(); + int const index = lex.GetInteger(); lex.nextToken(); int temp_int = lex.GetInteger(); params.user_defined_bullets[index].setFont(temp_int); @@ -671,7 +665,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, params.user_defined_bullets[index].setSize(temp_int); params.temp_bullets[index].setSize(temp_int); lex.nextToken(); - string temp_str = lex.GetString(); + string const temp_str = lex.GetString(); if (temp_str != "\\end_bullet") { // this element isn't really necessary for // parsing but is easier for humans @@ -682,9 +676,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, } } else if (token == "\\bulletLaTeX") { lex.nextToken(); - int index = lex.GetInteger(); + int const index = lex.GetInteger(); lex.next(); - string temp_str = lex.GetString(), sum_str; + string temp_str = lex.GetString(); + string sum_str; while (temp_str != "\\end_bullet") { // this loop structure is needed when user // enters an empty string since the first @@ -706,7 +701,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, params.tocdepth = lex.GetInteger(); } else if (token == "\\spacing") { lex.next(); - string tmp = strip(lex.GetString()); + string const tmp = strip(lex.GetString()); Spacing::Space tmp_space = Spacing::Default; float tmp_val = 0.0; if (tmp == "single") { @@ -731,7 +726,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, } } else if (token == "\\paragraph_spacing") { lex.next(); - string tmp = strip(lex.GetString()); + string const tmp = strip(lex.GetString()); if (tmp == "single") { par->spacing.set(Spacing::Single); } else if (tmp == "onehalf") { @@ -762,7 +757,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, font.setLyXSize(lex.GetString()); } else if (token == "\\latex") { lex.next(); - string tok = lex.GetString(); + string const tok = lex.GetString(); // This is dirty, but gone with LyX3. (Asger) if (tok == "no_latex") font.setLatex(LyXFont::OFF); @@ -775,7 +770,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, "`$$Token'"); } else if (token == "\\lang") { lex.next(); - string tok = lex.GetString(); + string const tok = lex.GetString(); Languages::iterator lit = languages.find(tok); if (lit != languages.end()) { font.setLanguage(&(*lit).second); @@ -788,7 +783,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, font.setEmph(font.setLyXMisc(lex.GetString())); } else if (token == "\\bar") { lex.next(); - string tok = lex.GetString(); + string const tok = lex.GetString(); // This is dirty, but gone with LyX3. (Asger) if (tok == "under") font.setUnderbar(LyXFont::ON); @@ -942,7 +937,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par, } lex.next(); - string tmptok = lex.GetString(); + string const tmptok = lex.GetString(); last_inset_read = tmptok; // test the different insets if (tmptok == "Quotes") { @@ -1013,7 +1008,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par, ++pos; } else if (tmptok == "Float") { lex.next(); - string tmptok = lex.GetString(); + string const tmptok = lex.GetString(); Inset * inset = new InsetFloat(tmptok); inset->Read(this, lex); par->InsertInset(pos, inset, font); @@ -1090,7 +1085,7 @@ bool Buffer::readFile(LyXLex & lex, LyXParagraph * par) { if (lex.IsOK()) { lex.next(); - string token(lex.GetString()); + string const token(lex.GetString()); if (token == "\\lyxformat") { // the first token _must_ be... lex.EatLine(); format = lex.GetFloat(); @@ -1205,7 +1200,7 @@ bool Buffer::save() const } else { // Saving failed, so backup is not backup if (lyxrc.make_backup) { - ::rename(s.c_str(), fileName().c_str()); + lyx::rename(s, fileName()); } return false; } @@ -1295,9 +1290,10 @@ bool Buffer::writeFile(string const & fname, bool flag) const void Buffer::writeFileAscii(string const & fname, int linelen) { - LyXFont font1, font2; Inset * inset; - char c, footnoteflag = 0, depth = 0; + char c; + char footnoteflag = 0; + char depth = 0; string tmp; LyXParagraph::size_type i; int j; @@ -1315,7 +1311,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen) return; } - string fname1 = TmpFileName(); + string const fname1 = TmpFileName(); LyXParagraph * par = paragraph; while (par) { int noparbreak = 0; @@ -1367,10 +1363,10 @@ void Buffer::writeFileAscii(string const & fname, int linelen) } else if (tmp == "Enumerate") { ltype = 2; ltype_depth = depth+1; - } else if (strstr(tmp.c_str(), "ection")) { + } else if (contains(tmp, "ection")) { ltype = 3; ltype_depth = depth+1; - } else if (strstr(tmp.c_str(), "aragraph")) { + } else if (contains(tmp, "aragraph")) { ltype = 4; ltype_depth = depth+1; } else if (tmp == "Description") { @@ -1409,7 +1405,8 @@ void Buffer::writeFileAscii(string const & fname, int linelen) #endif } - font1 = LyXFont(LyXFont::ALL_INHERIT, params.language_info); + LyXFont font1 = + LyXFont(LyXFont::ALL_INHERIT, params.language_info); actcell = 0; for (i = 0, actpos = 1; i < par->size(); ++i, ++actpos) { if (!i && !footnoteflag && !noparbreak){ @@ -1441,7 +1438,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen) currlinelen += (ltype_depth-depth)*2; } } - font2 = par->GetFontSettings(params, i); + LyXFont font2 = par->GetFontSettings(params, i); if (font1.latex() != font2.latex()) { if (font2.latex() == LyXFont::OFF) islatex = 0; @@ -1677,7 +1674,7 @@ void Buffer::makeLaTeXFile(string const & fname, } if (params.inputenc == "auto") { - string doc_encoding = + string const doc_encoding = params.language_info->encoding()->LatexName(); // Create a list with all the input encodings used @@ -2187,7 +2184,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) Inset * inset = par->GetInset(0); Inset::Code lyx_code = inset->LyxCode(); if (lyx_code == Inset::TOC_CODE){ - string temp = "toc"; + string const temp = "toc"; sgmlOpenTag(ofs, depth, temp); par = par->next; @@ -2199,13 +2196,13 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) } // environment tag closing - for( ; depth > par->depth; --depth) { + for (; depth > par->depth; --depth) { sgmlCloseTag(ofs, depth, environment_stack[depth]); environment_stack[depth].erase(); } // write opening SGML tags - switch(style.latextype) { + switch (style.latextype) { case LATEX_PARAGRAPH: if(depth == par->depth && !environment_stack[depth].empty()) { @@ -2237,7 +2234,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) case LATEX_ENVIRONMENT: case LATEX_ITEM_ENVIRONMENT: - if(depth == par->depth + if (depth == par->depth && environment_stack[depth] != style.latexname() && !environment_stack[depth].empty()) { @@ -2251,7 +2248,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) } if (environment_stack[depth] != style.latexname()) { if(depth == 0) { - string temp = "p"; + string const temp = "p"; sgmlOpenTag(ofs, depth, temp); } environment_stack[depth] = style.latexname(); @@ -2320,7 +2317,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) void Buffer::linuxDocHandleFootnote(ostream & os, LyXParagraph * & par, int const depth) { - string tag = "footnote"; + string const tag = "footnote"; while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) { sgmlOpenTag(os, depth + 1, tag); @@ -2379,9 +2376,9 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par, SOME_ENUM present = FOOTNOTE_LIKE; while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) { - if(last == present) { - if(inner_span) { - if(!tmp_par.empty()) { + if (last == present) { + if (inner_span) { + if (!tmp_par.empty()) { os << tmp_par; tmp_par.erase(); sgmlCloseTag(os, depth + 1, inner_tag); @@ -2392,10 +2389,10 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par, } } else { os << tmp_par; - if(!inner_tag.empty()) sgmlCloseTag(os, depth + 1, + if (!inner_tag.empty()) sgmlCloseTag(os, depth + 1, inner_tag); - if(!extra_par.empty()) os << extra_par; - if(!tag.empty()) sgmlCloseTag(os, depth, tag); + if (!extra_par.empty()) os << extra_par; + if (!tag.empty()) sgmlCloseTag(os, depth, tag); extra_par.erase(); switch (par->footnotekind) { @@ -2521,7 +2518,7 @@ void linux_doc_line_break(ostream & os, unsigned int & colcount, void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par, int desc_on, int const /*depth*/) { - LyXFont font1, font2; + LyXFont font1; char c; Inset * inset; LyXParagraph::size_type main_body; @@ -2565,7 +2562,7 @@ void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par, font1 = style.font; } - font2 = par->getFont(params, i); + LyXFont const font2 = par->getFont(params, i); if (font1.family() != font2.family()) { switch(family_type) { @@ -2856,7 +2853,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body) tmps = style.latexparam(); c_params = split(tmps, c_depth,'|'); - cmd_depth= atoi(c_depth.c_str()); + cmd_depth= lyx::atoi(c_depth); if(command_flag) { if(cmd_depthtext) return 0; - - ProhibitInput(users); - - // get LaTeX-Filename - string name = getLatexName(); - - string path = OnlyPath(filename); - - string org_path = path; - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { - path = tmppath; - } - - Path p(path); // path to LaTeX file - users->owner()->getMiniBuffer()->Set(_("Running LaTeX...")); - - // Remove all error insets - bool a = users->removeAutoInsets(); - - // Always generate the LaTeX file - makeLaTeXFile(name, org_path, false); - - // do the LaTex run(s) - TeXErrors terr; - string latex_command = lyxrc.pdf_mode ? - lyxrc.pdflatex_command : lyxrc.latex_command; - LaTeX latex(latex_command, name, filepath); - int res = latex.run(terr, - users->owner()->getMiniBuffer()); // running latex - - // check return value from latex.run(). - if ((res & LaTeX::NO_LOGFILE)) { - WriteAlert(_("LaTeX did not work!"), - _("Missing log file:"), name); - } else if ((res & LaTeX::ERRORS)) { - users->owner()->getMiniBuffer()->Set(_("Done")); - // Insert all errors as errors boxes - users->insertErrors(terr); - - // Dvi should also be kept dirty if the latex run - // ends up with errors. However it should be possible - // to view a dirty dvi too. - } else { - //no errors or any other things to think about so: - users->owner()->getMiniBuffer()->Set(_("Done")); - } - - // if we removed error insets before we ran LaTeX or if we inserted - // error insets after we ran LaTeX this must be run: - if (a || (res & LaTeX::ERRORS)){ - users->redraw(); - users->fitCursor(); - //users->updateScrollbar(); - } - AllowInput(users); - - return latex.getNumErrors(); -#else - return 0; -#endif -} - - int Buffer::runLiterate() { if (!users->text) return 0; @@ -3314,7 +3243,7 @@ int Buffer::buildProgram() lyxrc.literate_command, lyxrc.literate_error_filter, lyxrc.build_command, lyxrc.build_error_filter); TeXErrors terr; - int res = literate.build(terr, users->owner()->getMiniBuffer()); + int const res = literate.build(terr, users->owner()->getMiniBuffer()); // check return value from literate.build(). if ((res & Literate::NO_LOGFILE)) { @@ -3357,10 +3286,10 @@ int Buffer::runChktex() ProhibitInput(users); // get LaTeX-Filename - string name = getLatexName(); + string const name = getLatexName(); string path = OnlyPath(filename); - string org_path = path; + string const org_path = path; if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { path = tmppath; } @@ -3369,7 +3298,7 @@ int Buffer::runChktex() users->owner()->getMiniBuffer()->Set(_("Running chktex...")); // Remove all error insets - bool removedErrorInsets = users->removeAutoInsets(); + bool const removedErrorInsets = users->removeAutoInsets(); // Generate the LaTeX file if neccessary makeLaTeXFile(name, org_path, false); @@ -3427,9 +3356,9 @@ void Buffer::validate(LaTeXFeatures & features) const // so they are tested here for (int i = 0; i < 4; ++i) { if (params.user_defined_bullets[i] != ITEMIZE_DEFAULTS[i]) { - int font = params.user_defined_bullets[i].getFont(); + int const font = params.user_defined_bullets[i].getFont(); if (font == 0) { - int c = params + int const c = params .user_defined_bullets[i] .getCharacter(); if (c == 16 @@ -3439,11 +3368,9 @@ void Buffer::validate(LaTeXFeatures & features) const || c == 31) { features.latexsym = true; } - } - if (font == 1) { + } else if (font == 1) { features.amssymb = true; - } - else if ((font >= 2 && font <= 5)) { + } else if ((font >= 2 && font <= 5)) { features.pifont = true; } } @@ -3458,9 +3385,9 @@ void Buffer::validate(LaTeXFeatures & features) const void Buffer::setPaperStuff() { params.papersize = BufferParams::PAPER_DEFAULT; - char c1 = params.paperpackage; + char const c1 = params.paperpackage; if (c1 == BufferParams::PACKAGE_NONE) { - char c2 = params.papersize2; + char const c2 = params.papersize2; if (c2 == BufferParams::VM_PAPER_USLETTER) params.papersize = BufferParams::PAPER_USLETTER; else if (c2 == BufferParams::VM_PAPER_USLEGAL) @@ -3518,7 +3445,7 @@ vector const Buffer::getLabelList() vector label_list; for (inset_iterator it = inset_iterator_begin(); it != inset_iterator_end(); ++it) { - vector l = (*it)->getLabelList(); + vector const l = (*it)->getLabelList(); label_list.insert(label_list.end(), l.begin(), l.end()); } return label_list; @@ -3558,8 +3485,9 @@ vector > const Buffer::getTocList() } } else if (!par->IsDummy()) { #endif - char labeltype = textclasslist.Style(params.textclass, - par->GetLayout()).labeltype; + char const labeltype = + textclasslist.Style(params.textclass, + par->GetLayout()).labeltype; if (labeltype >= LABEL_COUNTER_CHAPTER && labeltype <= LABEL_COUNTER_CHAPTER + params.tocdepth) { @@ -3611,7 +3539,7 @@ vector > const Buffer::getBibkeyList() static_cast(*it)->getKeys(); keys.insert(keys.end(), tmp.begin(), tmp.end()); } else if ((*it)->LyxCode() == Inset::INCLUDE_CODE) { - vector > tmp = + vector > const tmp = static_cast(*it)->getKeys(); keys.insert(keys.end(), tmp.begin(), tmp.end()); } @@ -3640,7 +3568,7 @@ void Buffer::markDepClean(string const & name) dep_clean->master = name; dep_clean->next = 0; } else { - DEPCLEAN* item = dep_clean; + DEPCLEAN * item = dep_clean; while (item && item->master != name) item = item->next; if (item) { @@ -3658,10 +3586,11 @@ void Buffer::markDepClean(string const & name) bool Buffer::Dispatch(string const & command) { // Split command string into command and argument - string cmd, line = frontStrip(command); - string arg = strip(frontStrip(split(line, cmd, ' '))); + string cmd; + string line = frontStrip(command); + string const arg = strip(frontStrip(split(line, cmd, ' '))); - return Dispatch(lyxaction.LookupFunc(cmd.c_str()), arg); + return Dispatch(lyxaction.LookupFunc(cmd), arg); } @@ -3670,11 +3599,7 @@ bool Buffer::Dispatch(int action, string const & argument) bool dispatched = true; switch (action) { case LFUN_EXPORT: -#ifdef NEW_EXPORT Exporter::Export(this, argument, false); -#else - MenuExport(this, argument); -#endif break; default: @@ -3696,7 +3621,7 @@ void Buffer::resizeInsets(BufferView * bv) { /// then remove all LyXText in text-insets LyXParagraph * par = paragraph; - for(;par;par = par->next) { + for(; par; par = par->next) { par->resizeInsetsLyXText(bv); } } @@ -3714,7 +3639,6 @@ void Buffer::ChangeLanguage(Language const * from, Language const * to) bool Buffer::isMultiLingual() { - LyXParagraph * par = paragraph; while (par) { if (par->isMultiLingual(params)) @@ -3727,7 +3651,8 @@ bool Buffer::isMultiLingual() Buffer::inset_iterator::inset_iterator(LyXParagraph * paragraph, LyXParagraph::size_type pos) - : par(paragraph) { + : par(paragraph) +{ it = par->InsetIterator(pos); if (it == par->inset_iterator_end()) { par = par->next; @@ -3736,7 +3661,8 @@ Buffer::inset_iterator::inset_iterator(LyXParagraph * paragraph, } -void Buffer::inset_iterator::SetParagraph() { +void Buffer::inset_iterator::SetParagraph() +{ while (par) { it = par->inset_iterator_begin(); if (it != par->inset_iterator_end()) diff --git a/src/buffer.h b/src/buffer.h index 9991e5becc..39e5a51dfc 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -161,9 +161,6 @@ public: void latexParagraphs(std::ostream & os, LyXParagraph * par, LyXParagraph * endpar, TexRow & texrow) const; - /// - int runLaTeX(); - /// int runLiterate(); diff --git a/src/bufferlist.C b/src/bufferlist.C index 232297862f..0d4d660250 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -183,7 +183,7 @@ bool BufferList::close(Buffer * buf) else fname = MakeDisplayPath(buf->fileName(), 50); bool reask = true; - while(reask) { + while (reask) { switch(AskConfirmation(_("Changes in document:"), fname, _("Save document?"))){ @@ -362,7 +362,7 @@ Buffer * BufferList::readFile(string const & s, bool ronly) use_emergency = true; } else { // Here, we should delete the emergency save - ::unlink(e.c_str()); + lyx::unlink(e); } } } @@ -385,7 +385,7 @@ Buffer * BufferList::readFile(string const & s, bool ronly) b->markDirty(); } else { // Here, we should delete the autosave - ::unlink(a.c_str()); + lyx::unlink(a); } } } @@ -473,7 +473,7 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed) Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles) { // make sure our path is absolute - string s = MakeAbsPath(filename); + string const s = MakeAbsPath(filename); // file already open? if (exists(s)) { diff --git a/src/bufferparams.C b/src/bufferparams.C index 1a8fb3cac0..0a0a51ee94 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -165,7 +165,7 @@ void BufferParams::writeFile(ostream & os) const else { os << "\\bulletLaTeX " << i << "\n\t" - << user_defined_bullets[i].getText().c_str() + << user_defined_bullets[i].getText() << "\n\\end_bullet\n"; } } diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index 66fc4c0a24..26073afe8d 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -27,7 +27,6 @@ #include "lyx_cb.h" #include "layout_forms.h" -extern FD_form_paragraph * fd_form_paragraph; extern FD_form_character * fd_form_character; #ifndef NEW_INSETS @@ -168,10 +167,7 @@ void ProhibitInput(BufferView * bv) /* set the cursor to the watch for all forms and the canvas */ XDefineCursor(fl_display, bv->owner()->getForm()->window, cursor); - if (fd_form_paragraph->form_paragraph->visible) - XDefineCursor(fl_display, - fd_form_paragraph->form_paragraph->window, - cursor); + if (fd_form_character->form_character->visible) XDefineCursor(fl_display, fd_form_character->form_character->window, @@ -187,9 +183,7 @@ void AllowInput(BufferView * bv) /* reset the cursor from the watch for all forms and the canvas */ XUndefineCursor(fl_display, bv->owner()->getForm()->window); - if (fd_form_paragraph->form_paragraph->visible) - XUndefineCursor(fl_display, - fd_form_paragraph->form_paragraph->window); + if (fd_form_character->form_character->visible) XUndefineCursor(fl_display, fd_form_character->form_character->window); diff --git a/src/bullet_forms.C b/src/bullet_forms.C deleted file mode 100644 index 301f80b98e..0000000000 --- a/src/bullet_forms.C +++ /dev/null @@ -1,113 +0,0 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext -#include -#include "lyx_gui_misc.h" -#include "gettext.h" - -/* Form definition file generated with fdesign. */ - -#include FORMS_H_LOCATION -#include -#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; -} -/*---------------------------------------*/ - diff --git a/src/bullet_forms.h b/src/bullet_forms.h deleted file mode 100644 index 7012ab5ec7..0000000000 --- a/src/bullet_forms.h +++ /dev/null @@ -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_ */ diff --git a/src/bullet_forms_cb.C b/src/bullet_forms_cb.C deleted file mode 100644 index 0531db3c7d..0000000000 --- a/src/bullet_forms_cb.C +++ /dev/null @@ -1,246 +0,0 @@ -/* Bullet form callbacks */ -#include -#include -#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()); -} diff --git a/src/chset.C b/src/chset.C index b08adfed4d..3d8f1e891f 100644 --- a/src/chset.C +++ b/src/chset.C @@ -10,6 +10,7 @@ #include "support/filetools.h" #include "support/LRegex.h" #include "support/LSubstring.h" +#include "support/lyxlib.h" #include "debug.h" using std::ifstream; @@ -29,7 +30,7 @@ bool CharacterSet::loadFile(string const & fname) // open definition file lyxerr[Debug::KBMAP] << "Reading character set file " << fname << ".cdef" << endl; - string filename = LibFileSearch("kbd", fname.c_str(), "cdef"); + string filename = LibFileSearch("kbd", fname, "cdef"); ifstream ifs(filename.c_str()); if (!ifs) { lyxerr << "Unable to open character set file" << endl; @@ -48,8 +49,8 @@ bool CharacterSet::loadFile(string const & fname) while(getline(ifs, line)) { if (reg.exact_match(line)) { LRegex::SubMatches const & sub = reg.exec(line); - n = atoi(line.substr(sub[1].first, - sub[1].second).c_str()); + n = lyx::atoi(line.substr(sub[1].first, + sub[1].second)); str = LSubstring(line, sub[2].first, sub[2].second); if (lyxerr.debugging(Debug::KBMAP)) lyxerr << "Chardef: " << n diff --git a/src/commandtags.h b/src/commandtags.h index e67f605eaf..19c8c8d287 100644 --- a/src/commandtags.h +++ b/src/commandtags.h @@ -12,8 +12,6 @@ #include -//#define NEW_EXPORT 1 - /** These are all the lyxfunctions (as enums). Please add new functions at the end of the enum, right before LFUN_LASTACTION. @@ -29,15 +27,9 @@ enum kb_action { LFUN_MENUWRITEAS, LFUN_MENUPRINT, LFUN_MENUSENDTO, -#ifndef NEW_EXPORT - LFUN_RUNLATEX, -#endif LFUN_BUILDPROG, // 10 LFUN_TOCVIEW, LFUN_PREVIEW, -#ifndef NEW_EXPORT - LFUN_PREVIEWPS, -#endif LFUN_CLOSEBUFFER, LFUN_BUFFER_PRINT, // ARRae 20000313 LFUN_PRINTER_PARAMS_GET, // ARRae 20000313 @@ -159,9 +151,6 @@ enum kb_action { LFUN_LAYOUT_CHARACTER, LFUN_LAYOUT_PARAGRAPH, LFUN_LAYOUT_DOCUMENT, - LFUN_LAYOUT_PAPER, - LFUN_LAYOUT_TABLE, - LFUN_LAYOUT_QUOTES, LFUN_LAYOUT_PREAMBLE, LFUN_LAYOUT_SAVE_DEFAULT, LFUN_DROP_LAYOUTS_CHOICE, // 140 @@ -197,9 +186,6 @@ enum kb_action { LFUN_BACKSPACE_SKIP, // 170 LFUN_DELETE_SKIP, LFUN_MENUNEWTMPLT, // Asger 1997-02-02 -#ifndef NEW_EXPORT - LFUN_RUNDVIPS, // Asger 1997-02-02 -#endif LFUN_MENURELOAD, // Asger 1997-02-02 LFUN_FAX, // Asger 1997-02-10 LFUN_RECONFIGURE, // Asger 1997-02-14 @@ -239,7 +225,6 @@ enum kb_action { LFUN_LDOTS, // Asger 970929 LFUN_END_OF_SENTENCE, // Asger 970929 LFUN_RUNCHKTEX, // Asger 971030 - LFUN_BUFFERBULLETSSELECT, // ARRae 971018 LFUN_TOGGLECURSORFOLLOW, // ARRae 971202 LFUN_HTMLURL, // CFO-G 971121 LFUN_URL, // CFO-G 971121 diff --git a/src/converter.C b/src/converter.C index c964d685c9..cc4bb3a453 100644 --- a/src/converter.C +++ b/src/converter.C @@ -275,7 +275,7 @@ bool Converter::Convert(Buffer * buffer, string const & from_file, string to_format = GetExtension(to_file); if (from_format == to_format) if (from_file != to_file) - return lyx::rename(from_file.c_str(), to_file.c_str()); + return lyx::rename(from_file, to_file); else return true; @@ -408,15 +408,15 @@ bool Converter::Convert(Buffer * buffer, string const & from_file, "$$BaseName", from_base); string to = subst((*it).result_dir, "$$BaseName", to_base); - return lyx::rename(from.c_str(), to.c_str()); + return lyx::rename(from, to); } } else if (outfile != to_file) if ((*it).from == "tex" && ( (*it).to == "dvi" || (*it).to == "pdf") ) - return lyx::copy(outfile.c_str(), to_file.c_str()); + return lyx::copy(outfile, to_file); else - return lyx::rename(outfile.c_str(), to_file.c_str()); + return lyx::rename(outfile, to_file); return true; } diff --git a/src/counters.C b/src/counters.C index a9a89aef28..211791f981 100644 --- a/src/counters.C +++ b/src/counters.C @@ -77,7 +77,7 @@ Counters::~Counters() void Counters::newCounter(string const & newc) { // First check if newc already exist - CounterList::const_iterator cit = counterList.find(newc); + CounterList::iterator cit = counterList.find(newc); // if alrady exist give warning and return if (cit != counterList.end()) { lyxerr << "The new counter already exist." << endl; @@ -90,7 +90,7 @@ void Counters::newCounter(string const & newc) void Counters::newCounter(string const & newc, string const & oldc) { // First check if newc already exist - CounterList::const_iterator cit = counterList.find(newc); + CounterList::iterator cit = counterList.find(newc); // if already existant give warning and return if (cit != counterList.end()) { lyxerr << "The new counter already exist." << endl; diff --git a/src/credits_form.C b/src/credits_form.C index f686225025..a5e2d70a33 100644 --- a/src/credits_form.C +++ b/src/credits_form.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -34,7 +34,7 @@ FD_form_credits *create_form_form_credits(void) fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); fl_end_form(); - //fdui->form_credits->fdui = fdui; + fdui->form_credits->fdui = fdui; return fdui; } diff --git a/src/exporter.h b/src/exporter.h index b052f591b3..94a832dbb8 100644 --- a/src/exporter.h +++ b/src/exporter.h @@ -43,7 +43,4 @@ public: static string const BufferExtension(Buffer const * buffer); }; - -#define NEW_EXPORT 1 - #endif diff --git a/src/filedlg.C b/src/filedlg.C index ff6b37e1bf..43167d9d68 100644 --- a/src/filedlg.C +++ b/src/filedlg.C @@ -60,7 +60,6 @@ using std::sort; #ifdef BROKEN_HEADERS extern "C" int gettimeofday(struct timeval *, struct timezone *); -#define remove(a) unlink(a) #endif #ifdef __GNUG__ @@ -183,12 +182,12 @@ LyXFileDlg * LyXFileDlg::pCurrentDlg = 0; void LyXFileDlg::Reread() { // Opens directory - DIR * pDirectory = opendir(pszDirectory.c_str()); + DIR * pDirectory = ::opendir(pszDirectory.c_str()); if (!pDirectory) { WriteFSAlert(_("Warning! Couldn't open directory."), pszDirectory); pszDirectory = GetCWD(); - pDirectory = opendir(pszDirectory.c_str()); + pDirectory = ::opendir(pszDirectory.c_str()); } // Clear the present namelist diff --git a/src/font.C b/src/font.C index 96cb595f00..076f16d7b2 100644 --- a/src/font.C +++ b/src/font.C @@ -155,10 +155,10 @@ int lyxfont::width(char const * s, int n, LyXFont const & f) int lyxfont::signedWidth(string const & s, LyXFont const & f) { if (s.empty()) return 0; - if (s.c_str()[0] == '-') - return -width(s.c_str() + 1, s.length() - 1, f); + if (s[0] == '-') + return -width(s.substr(1, s.length() - 1), f); else - return width(s.c_str(), s.length(), f); + return width(s, f); } diff --git a/src/form1.C b/src/form1.C index c6379ba7a0..7c1e5b239f 100644 --- a/src/form1.C +++ b/src/form1.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -21,12 +21,12 @@ FD_KeyMap *create_form_KeyMap(void) fdui->AcceptChset = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 280, 170, 30, idex(_("Set Charset|#C")));fl_set_button_shortcut(obj, scex(_("Set Charset|#C")), 1); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fdui->ChsetErr = obj = fl_add_text(FL_NORMAL_TEXT, 210, 310, 170, 30, _("Charset not found!")); - fl_set_object_lcol(obj, FL_RED); + fl_set_object_lcolor(obj, FL_RED); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE); fl_set_object_lstyle(obj, FL_BOLD_STYLE+FL_EMBOSSED_STYLE); fdui->KeymapErr = obj = fl_add_text(FL_NORMAL_TEXT, 290, 60, 100, 90, _("Error:\n\nKeymap\nnot found")); - fl_set_object_lcol(obj, FL_RED); + fl_set_object_lcolor(obj, FL_RED); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE); fl_set_object_lstyle(obj, FL_BOLD_STYLE+FL_EMBOSSED_STYLE); @@ -75,7 +75,7 @@ FD_KeyMap *create_form_KeyMap(void) fl_set_object_lalign(obj, FL_ALIGN_RIGHT|FL_ALIGN_INSIDE); fl_end_form(); - //fdui->KeyMap->fdui = fdui; + fdui->KeyMap->fdui = fdui; return fdui; } @@ -212,7 +212,7 @@ FD_Figure *create_form_Figure(void) fl_set_object_callback(obj, GraphicsCB, 70); fl_end_form(); - //fdui->Figure->fdui = fdui; + fdui->Figure->fdui = fdui; return fdui; } @@ -268,39 +268,7 @@ FD_FileDlg *create_form_FileDlg(void) fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); fl_end_form(); - //fdui->FileDlg->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - -FD_form_table *create_form_form_table(void) -{ - FL_OBJECT *obj; - FD_form_table *fdui = (FD_form_table *) fl_calloc(1, sizeof(FD_form_table)); - - fdui->form_table = fl_bgn_form(FL_NO_BOX, 310, 130); - obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, ""); - fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, TableOKCB, 0); - fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 90, 90, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, TableApplyCB, 0); - fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 90, 90, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, TableCancelCB, 0); - fdui->slider_columns = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 50, 220, 30, _("Columns")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_resize(obj, FL_RESIZE_X); - fdui->slider_rows = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 10, 220, 30, _("Rows")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_resize(obj, FL_RESIZE_X); - fl_end_form(); - - //fdui->form_table->fdui = fdui; + fdui->FileDlg->fdui = fdui; return fdui; } @@ -349,7 +317,7 @@ FD_form_search *create_form_form_search(void) fl_set_object_callback(obj, SearchReplaceAllCB, 0); fl_end_form(); - //fdui->form_search->fdui = fdui; + fdui->form_search->fdui = fdui; return fdui; } diff --git a/src/form1.h b/src/form1.h index d9b64a4b88..d26101da33 100644 --- a/src/form1.h +++ b/src/form1.h @@ -8,10 +8,6 @@ extern "C" void GraphicsCB(FL_OBJECT *, long); -extern "C" void TableOKCB(FL_OBJECT *, long); -extern "C" void TableApplyCB(FL_OBJECT *, long); -extern "C" void TableCancelCB(FL_OBJECT *, long); - extern "C" void SearchForwardCB(FL_OBJECT *, long); extern "C" void SearchBackwardCB(FL_OBJECT *, long); extern "C" void SearchReplaceCB(FL_OBJECT *, long); @@ -98,19 +94,6 @@ typedef struct { } FD_FileDlg; extern FD_FileDlg * create_form_FileDlg(void); -typedef struct { - FL_FORM *form_table; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *button_ok; - FL_OBJECT *button_apply; - FL_OBJECT *button_cancel; - FL_OBJECT *slider_columns; - FL_OBJECT *slider_rows; -} FD_form_table; - -extern FD_form_table * create_form_form_table(void); typedef struct { FL_FORM *form_search; void *vdata; diff --git a/src/frontends/Liason.C b/src/frontends/Liason.C index c0a4b31fc3..14d7fd3dda 100644 --- a/src/frontends/Liason.C +++ b/src/frontends/Liason.C @@ -32,10 +32,6 @@ using std::endl; extern LyXRC lyxrc; -#ifndef NEW_EXPORT -extern bool RunScript(Buffer * buffer, bool wait, string const & command, - string const & orgname = string(), bool need_shell=true); -#endif #ifdef CXX_WORKING_NAMESPACES namespace Liason @@ -53,9 +49,6 @@ PrinterParams getPrinterParams(Buffer * buffer) bool printBuffer(Buffer * buffer, PrinterParams const & pp) { -#ifndef NEW_EXPORT - bool result(false); -#endif string command(lyxrc.print_command + ' '); if (pp.target == PrinterParams::PRINTER @@ -112,7 +105,6 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp) command += Converter::dvips_options(buffer) + ' '; -#ifdef NEW_EXPORT if (!Exporter::Export(buffer, "dvi", true)) return false; @@ -163,57 +155,6 @@ bool printBuffer(Buffer * buffer, PrinterParams const & pp) break; } return res == 0; -#else - // Push directory path if necessary. - // PS file should go where the source file is unless it's a - // read-only directory in which case we write it to tmpdir. - // All temporary files go in tmpdir (like spool files). - string path = OnlyPath(buffer->fileName()); - if ((pp.target != PrinterParams::FILE - && lyxrc.use_tempdir) - || (IsDirWriteable(path) < 1)) { - path = buffer->tmppath; - } - Path p(path); - - // there are three cases here: - // 1. we print to a file - // 2. we print direct to a printer - // 3. we print using a spool command (print to file first) - switch (pp.target) { - case PrinterParams::PRINTER: - if (!lyxrc.print_spool_command.empty()) { - // case 3 - command += lyxrc.print_to_file - + QuoteName(pp.file_name); - string command2 = lyxrc.print_spool_command - + ' '; - if (!pp.printer_name.empty()) { - command2 += lyxrc.print_spool_printerprefix - + pp.printer_name; - } - // First run dvips. - // If successful, then spool command - if (result = RunScript(buffer, true, command)) { - result = RunScript(buffer, false, - command2, - QuoteName(pp.file_name)); - } - } else { - // case 2 - result = RunScript(buffer, false, command); - } - break; - - case PrinterParams::FILE: - // case 1 - command += lyxrc.print_to_file - + QuoteName(MakeAbsPath(pp.file_name, path)); - result = RunScript(buffer, false, command); - break; - } - return result; -#endif } void setMinibuffer(LyXView * lv, char const * msg) diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index b059aea40f..1cd89f50c2 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -210,7 +210,7 @@ void FormDocument::build() fl_end_form(); // "default" is not part of the languages array any more. combo_language->addto("default"); - for(Languages::const_iterator cit = languages.begin(); + for(Languages::iterator cit = languages.begin(); cit != languages.end(); ++cit) { combo_language->addto((*cit).second.lang().c_str()); } diff --git a/src/frontends/xforms/FormError.h b/src/frontends/xforms/FormError.h index 6def4551c1..522ac134c7 100644 --- a/src/frontends/xforms/FormError.h +++ b/src/frontends/xforms/FormError.h @@ -23,7 +23,7 @@ struct FD_form_error; /** This class provides an XForms implementation of the FormError Dialog. */ -class FormError : public FormBase, public noncopyable { +class FormError : public FormBase { public: /// Constructor FormError(LyXView *, Dialogs *); diff --git a/src/frontends/xforms/Menubar_pimpl.C b/src/frontends/xforms/Menubar_pimpl.C index a7f002431b..bd5bbec2b4 100644 --- a/src/frontends/xforms/Menubar_pimpl.C +++ b/src/frontends/xforms/Menubar_pimpl.C @@ -71,7 +71,7 @@ inline int string_width(string const & str) { return fl_get_string_widthTAB(FL_NORMAL_STYLE, MENU_LABEL_SIZE, - str.c_str(), str.length()); + str.c_str(), str.length()); } //Defined later, used in set(). diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index 788135c251..4492fafb75 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -264,7 +264,7 @@ extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data) // What are we supposed to do with that?? int Toolbar::get_toolbar_func(string const & func) { - int action = lyxaction.LookupFunc(func.c_str()); + int action = lyxaction.LookupFunc(func); if (action == -1) { if (func == "separator"){ action = TOOL_SEPARATOR; diff --git a/src/frontends/xforms/Toolbar_pimpl.h b/src/frontends/xforms/Toolbar_pimpl.h index f070ebae09..d9af62d54a 100644 --- a/src/frontends/xforms/Toolbar_pimpl.h +++ b/src/frontends/xforms/Toolbar_pimpl.h @@ -51,7 +51,7 @@ public: */ void edit(); /// add a new button to the toolbar. - void add(int , bool doclean = true); + void add(int, bool doclean = true); /// invokes the n'th icon in the toolbar void push(int); /// activates the toolbar diff --git a/src/frontends/xforms/forms/makefile b/src/frontends/xforms/forms/makefile index 39154511e5..c53066e9d4 100644 --- a/src/frontends/xforms/forms/makefile +++ b/src/frontends/xforms/forms/makefile @@ -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 ### Rewritten by Angus Leeming. +### Only update files that really have changed. (Lgb 20000924)) SHELL = /bin/sh .SUFFIXES: .fd .c @@ -43,7 +44,9 @@ all: test: clean $(OBJS) updatesrc: test - mv *.C *.h .. + for fil in *.C *.h ; do \ + cmp -s $$fil ../$$fil || mv $$fil .. \ + done .fd.C: ${SHELL} ./fdfix.sh $< diff --git a/src/graphics/GraphicsCache.C b/src/graphics/GraphicsCache.C index adb20613d6..534c984760 100644 --- a/src/graphics/GraphicsCache.C +++ b/src/graphics/GraphicsCache.C @@ -52,7 +52,7 @@ GraphicsCache::~GraphicsCache() GraphicsCacheItem * GraphicsCache::addFile(string const & filename) { - CacheType::const_iterator it = cache.find(filename); + CacheType::iterator it = cache.find(filename); if (it != cache.end()) { return new GraphicsCacheItem( *((*it).second) ); diff --git a/src/graphics/GraphicsCacheItem_pimpl.C b/src/graphics/GraphicsCacheItem_pimpl.C index d13c7d37b5..293cf2f9ad 100644 --- a/src/graphics/GraphicsCacheItem_pimpl.C +++ b/src/graphics/GraphicsCacheItem_pimpl.C @@ -13,8 +13,6 @@ #include -#include // unlink - #include FORMS_H_LOCATION #ifdef __GNUG__ @@ -150,7 +148,7 @@ GraphicsCacheItem_pimpl::loadXPMImage() } // remove the xpm file now. - ::unlink(xpmfile.c_str()); + lyx::unlink(xpmfile); // and remove the reference to the filename. xpmfile = string(); } diff --git a/src/insets/ExternalTemplate.h b/src/insets/ExternalTemplate.h index a0dfcbd7f9..63f85dbdec 100644 --- a/src/insets/ExternalTemplate.h +++ b/src/insets/ExternalTemplate.h @@ -76,7 +76,7 @@ class ExternalTemplateManager : public noncopyable { public: /// Map from the LyX name of the template to the template structure typedef std::map Templates; - + static ExternalTemplateManager & get(); Templates & getTemplates(); Templates const & getTemplates() const; diff --git a/src/insets/figinset.C b/src/insets/figinset.C index 9ece103b1a..35b4a6a63a 100644 --- a/src/insets/figinset.C +++ b/src/insets/figinset.C @@ -161,7 +161,7 @@ void kill_gs(int pid, int sig) if (lyxerr.debugging()) lyxerr << "Killing gs " << pid << endl; lyx::kill(pid, sig); - unlink(make_tmp(pid).c_str()); + lyx::unlink(make_tmp(pid)); } @@ -661,7 +661,7 @@ void runqueue() // now chdir into dir with .eps file, to be on the safe // side - ::chdir(OnlyPath(p->data->fname).c_str()); + lyx::chdir(OnlyPath(p->data->fname)); // make temp file name string tmpf = make_tmp(getpid()); if (lyxerr.debugging()) { @@ -684,7 +684,7 @@ void runqueue() lyxerr.debug() << "Cmd: " << lyxrc.ps_command << " -sDEVICE=x11 " - << tmpf.c_str() << ' ' + << tmpf << ' ' << p->data->fname << endl; _exit(0); // no gs? } @@ -832,7 +832,7 @@ void sigchldchecker(pid_t pid, int * status) p->broken = false; } else { // remove temporary files - unlink(make_tmp(p->gspid).c_str()); + lyx::unlink(make_tmp(p->gspid)); p->gspid = -1; p->broken = true; } @@ -1952,7 +1952,7 @@ void InsetFig::BrowseFile() buf = MakeAbsPath(p, buf2); buf = OnlyPath(buf); } else { - buf = OnlyPath(owner->fileName().c_str()); + buf = OnlyPath(owner->fileName()); } // Does user clipart directory exist? diff --git a/src/insets/insetbib.C b/src/insets/insetbib.C index 2cf364350d..99bb4989ef 100644 --- a/src/insets/insetbib.C +++ b/src/insets/insetbib.C @@ -349,7 +349,7 @@ void InsetBibtex::Edit(BufferView * bv, int, int, unsigned int) bool InsetBibtex::addDatabase(string const & db) { string contents(getContents()); - if (!contains(contents, db.c_str())) { + if (!contains(contents, db)) { if (!contents.empty()) contents += ","; setContents(contents + db); @@ -361,14 +361,14 @@ bool InsetBibtex::addDatabase(string const & db) bool InsetBibtex::delDatabase(string const & db) { - if (contains(getContents(), db.c_str())) { + if (contains(getContents(), db)) { string bd = db; int n = tokenPos(getContents(), ',', bd); if (n > 0) { // Weird code, would someone care to explain this?(Lgb) string tmp(", "); tmp += bd; - setContents(subst(getContents(), tmp.c_str(), ", ")); + setContents(subst(getContents(), tmp, ", ")); } else if (n == 0) setContents(split(getContents(), bd, ',')); else diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 1f6f9a0a5e..e73bdd0cd2 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -100,7 +100,7 @@ void InsetCollapsable::Read(Buffer const * buf, LyXLex & lex) int InsetCollapsable::ascent_collapsed(Painter & pain, LyXFont const &) const { int width = 0, ascent = 0, descent = 0; - pain.buttonText(0, 0, label.c_str(), labelfont, false, + pain.buttonText(0, 0, label, labelfont, false, width, ascent, descent); return ascent; } @@ -109,7 +109,7 @@ int InsetCollapsable::ascent_collapsed(Painter & pain, LyXFont const &) const int InsetCollapsable::descent_collapsed(Painter & pain, LyXFont const &) const { int width = 0, ascent = 0, descent = 0; - pain.buttonText(0, 0, label.c_str(), labelfont, false, + pain.buttonText(0, 0, label, labelfont, false, width, ascent, descent); return descent; } @@ -118,7 +118,7 @@ int InsetCollapsable::descent_collapsed(Painter & pain, LyXFont const &) const int InsetCollapsable::width_collapsed(Painter & pain, LyXFont const &) const { int width, ascent, descent; - pain.buttonText(TEXT_TO_INSET_OFFSET, 0, label.c_str(), labelfont, false, + pain.buttonText(TEXT_TO_INSET_OFFSET, 0, label, labelfont, false, width, ascent, descent); return width + (2*TEXT_TO_INSET_OFFSET); } @@ -156,7 +156,7 @@ void InsetCollapsable::draw_collapsed(Painter & pain, LyXFont const &, { int width = 0; pain.buttonText(int(x) + TEXT_TO_INSET_OFFSET, - baseline, label.c_str(), labelfont, true, width); + baseline, label, labelfont, true, width); x += width + TEXT_TO_INSET_OFFSET; } diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index 6da89c9812..7af977b034 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -42,7 +42,7 @@ InsetExternal::InsetExternal() InsetExternal::~InsetExternal() { - remove(tempname.c_str()); + lyx::unlink(tempname); } @@ -123,7 +123,7 @@ void InsetExternal::browseCB(FL_OBJECT * ob, long) buf = MakeAbsPath(p, buf2); buf = OnlyPath(buf); } else { - buf = OnlyPath(holder->view->buffer()->fileName().c_str()); + buf = OnlyPath(holder->view->buffer()->fileName()); } fileDlg.SetButton(0, _("Document"), buf); @@ -484,14 +484,14 @@ string const InsetExternal::doSubstitution(Buffer const * buffer, // Handle the $$Contents(filename) syntax if (contains(result, "$$Contents(\"")) { - int pos = result.find("$$Contents(\""); - int end = result.find("\")", pos); - string file = result.substr(pos + 12, end - (pos + 12)); + int const pos = result.find("$$Contents(\""); + int const end = result.find("\")", pos); + string const file = result.substr(pos + 12, end - (pos + 12)); string contents; if (buffer) { // Make sure we are in the directory of the buffer - string buf = MakeAbsPath(buffer->fileName()); - string path = OnlyPath(buf); + string const buf = MakeAbsPath(buffer->fileName()); + string const path = OnlyPath(buf); Path p(path); contents = GetFileContents(file); } else { @@ -514,7 +514,7 @@ string const InsetExternal::getCurrentTemplate() const ExternalTemplate const InsetExternal::getTemplate(string const & name) const { - ExternalTemplateManager::Templates::const_iterator i = + ExternalTemplateManager::Templates::iterator i = ExternalTemplateManager::get().getTemplates().find(name); // Make sure that the template exists in the map if (i == ExternalTemplateManager::get().getTemplates().end()) { diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 0a104ae345..507ec59681 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -90,9 +90,8 @@ InsetFloat::InsetFloat(string const & type) font.setColor(LColor::footnote); setLabelFont(font); setAutoCollapse(false); -// setInsetName("Float"); floatType = type; - setInsetName(type.c_str()); + setInsetName(type); //floatPlacement = "H"; } diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 14dc19a9dd..e1bf457006 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -104,7 +104,7 @@ void include_cb(FL_OBJECT *, long arg) { // Should browsing too be disabled in RO-mode? LyXFileDlg fileDlg; - string mpath = OnlyPath(inset->getMasterFilename()); + string const mpath = OnlyPath(inset->getMasterFilename()); string ext; if (fl_get_button(form->flag2)) // Use Input Button @@ -117,15 +117,16 @@ void include_cb(FL_OBJECT *, long arg) fileDlg.SetButton(0, _("Documents"), lyxrc.document_path); // Use by default the master's path - string filename = fileDlg.Select(_("Select Child Document"), - mpath, ext, - inset->getContents()); + string const filename = + fileDlg.Select(_("Select Child Document"), + mpath, ext, + inset->getContents()); XFlush(fl_get_display()); // check selected filename if (!filename.empty()) { - string filename2 = MakeRelPath(filename, - mpath); + string const filename2 = MakeRelPath(filename, + mpath); if (prefixIs(filename2, "..")) fl_set_input(form->input, filename.c_str()); @@ -192,7 +193,7 @@ void include_cb(FL_OBJECT *, long arg) static inline string unique_id() { - static unsigned int seed=1000; + static unsigned int seed = 1000; std::ostringstream ost; ost << "file" << ++seed; @@ -347,22 +348,20 @@ bool InsetInclude::loadIfNeeded() const // the readonly flag can/will be wrong, not anymore I think. FileInfo finfo(getFileName()); - bool ro = !finfo.writable(); - return ( bufferlist.readFile(getFileName(), ro) != 0 ); + bool const ro = !finfo.writable(); + return bufferlist.readFile(getFileName(), ro) != 0; } int InsetInclude::Latex(Buffer const *, ostream & os, bool /*fragile*/, bool /*fs*/) const { + string incfile(getContents()); + // Do nothing if no file name has been specified - if (getContents().empty()) + if (incfile.empty()) return 0; - // Use += to force a copy of contents (JMarc) - // How does that force anything? (Lgb) - string incfile(getContents()); - if (loadIfNeeded()) { Buffer * tmp = bufferlist.getBuffer(getFileName()); @@ -424,12 +423,12 @@ int InsetInclude::Latex(Buffer const *, ostream & os, int InsetInclude::Linuxdoc(Buffer const *, ostream & os) const { + string incfile(getContents()); + // Do nothing if no file name has been specified - if (getContents().empty()) + if (incfile.empty()) return 0; - string incfile(getContents()); - if (loadIfNeeded()) { Buffer * tmp = bufferlist.getBuffer(getFileName()); @@ -461,12 +460,12 @@ int InsetInclude::Linuxdoc(Buffer const *, ostream & os) const int InsetInclude::DocBook(Buffer const *, ostream & os) const { + string incfile(getContents()); + // Do nothing if no file name has been specified - if (getContents().empty()) + if (incfile.empty()) return 0; - string incfile(getContents()); - if (loadIfNeeded()) { Buffer * tmp = bufferlist.getBuffer(getFileName()); @@ -529,17 +528,16 @@ void InsetInclude::Validate(LaTeXFeatures & features) const vector const InsetInclude::getLabelList() const { - vector l; - string parentname; + vector l; - if (loadIfNeeded()) { - Buffer * tmp = bufferlist.getBuffer(getFileName()); - tmp->setParentName(""); - l = tmp->getLabelList(); - tmp->setParentName(getMasterFilename()); - } + if (loadIfNeeded()) { + Buffer * tmp = bufferlist.getBuffer(getFileName()); + tmp->setParentName(""); + l = tmp->getLabelList(); + tmp->setParentName(getMasterFilename()); + } - return l; + return l; } @@ -548,9 +546,9 @@ vector > const InsetInclude::getKeys() const vector > keys; if (loadIfNeeded()) { - Buffer *tmp = bufferlist.getBuffer(getFileName()); + Buffer * tmp = bufferlist.getBuffer(getFileName()); tmp->setParentName(""); - keys = tmp->getBibkeyList(); + keys = tmp->getBibkeyList(); tmp->setParentName(getMasterFilename()); } diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index eaa053afae..59fb7c7732 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -231,12 +231,12 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, int nx; float cx; - UpdatableInset::draw(bv,font,baseline,x,cleared); + UpdatableInset::draw(bv, font, baseline, x, cleared); if (!cleared && ((need_update == INIT) || (need_update == FULL) || (top_x != int(x)) || (top_baseline != baseline))) { int h = ascent(bv, font) + descent(bv, font); - int tx = display()||!owner()? 0:top_x; - int w = tx? width(bv, font):pain.paperWidth(); + int tx = display() || !owner() ? 0 : top_x; + int w = tx ? width(bv, font) : pain.paperWidth(); int ty = baseline - ascent(bv, font); if (ty < 0) @@ -256,12 +256,12 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, bool dodraw; x += ADD_TO_TABULAR_WIDTH; if (cleared || (need_update == FULL) || (need_update == CELL)) { - for(i=0;irows();++i) { + for(i = 0; i < tabular->rows(); ++i) { nx = int(x); - dodraw = ((baseline+tabular->GetDescentOfRow(i)) > 0) && - (baseline-tabular->GetAscentOfRow(i)) < pain.paperHeight(); - for(j=0;jcolumns();++j) { - if (tabular->IsPartOfMultiColumn(i,j)) + dodraw = ((baseline + tabular->GetDescentOfRow(i)) > 0) && + (baseline - tabular->GetAscentOfRow(i)) < pain.paperHeight(); + for(j = 0; j < tabular->columns(); ++j) { + if (tabular->IsPartOfMultiColumn(i, j)) continue; cx = nx + tabular->GetBeginningOfTextInCell(cell); if (hasSelection()) @@ -274,15 +274,15 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, if (need_update == CELL) { // clear before the inset pain.fillRectangle( - nx+1, - baseline - tabular->GetAscentOfRow(i)+1, - cx - nx - 1, + nx + 1, + baseline - tabular->GetAscentOfRow(i) + 1, + int(cx - nx - 1), tabular->GetAscentOfRow(i) + tabular->GetDescentOfRow(i) - 1); // clear behind the inset pain.fillRectangle( - cx + the_locking_inset->width(bv,font) + 1, - baseline - tabular->GetAscentOfRow(i)+1, + int(cx + the_locking_inset->width(bv,font) + 1), + baseline - tabular->GetAscentOfRow(i) + 1, tabular->GetWidthOfColumn(cell) - tabular->GetBeginningOfTextInCell(cell) - the_locking_inset->width(bv,font) - 1, @@ -302,8 +302,8 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, ++cell; } baseline += tabular->GetDescentOfRow(i) + - tabular->GetAscentOfRow(i+1)+ - tabular->GetAdditionalHeight(cell+1); + tabular->GetAscentOfRow(i + 1) + + tabular->GetAdditionalHeight(cell + 1); } } x -= ADD_TO_TABULAR_WIDTH; @@ -325,28 +325,28 @@ void InsetTabular::DrawCellLines(Painter & pain, int x, int baseline, on_off = !tabular->TopLine(cell); pain.line(x, baseline - tabular->GetAscentOfRow(row), x2, baseline - tabular->GetAscentOfRow(row), - on_off ? LColor::tabularonoffline:LColor::tabularline, - on_off ? Painter::line_onoffdash:Painter::line_solid); + on_off ? LColor::tabularonoffline : LColor::tabularline, + on_off ? Painter::line_onoffdash : Painter::line_solid); } on_off = !tabular->BottomLine(cell); pain.line(x,baseline + tabular->GetDescentOfRow(row), x2, baseline + tabular->GetDescentOfRow(row), - on_off ? LColor::tabularonoffline:LColor::tabularline, - on_off ? Painter::line_onoffdash:Painter::line_solid); + on_off ? LColor::tabularonoffline : LColor::tabularline, + on_off ? Painter::line_onoffdash : Painter::line_solid); if (!tabular->LeftAlreadyDrawed(cell)) { on_off = !tabular->LeftLine(cell); pain.line(x, baseline - tabular->GetAscentOfRow(row), x, baseline + tabular->GetDescentOfRow(row), - on_off ? LColor::tabularonoffline:LColor::tabularline, - on_off ? Painter::line_onoffdash:Painter::line_solid); + on_off ? LColor::tabularonoffline : LColor::tabularline, + on_off ? Painter::line_onoffdash : Painter::line_solid); } on_off = !tabular->RightLine(cell); pain.line(x2 - tabular->GetAdditionalWidth(cell), baseline - tabular->GetAscentOfRow(row), x2 - tabular->GetAdditionalWidth(cell), baseline + tabular->GetDescentOfRow(row), - on_off ? LColor::tabularonoffline:LColor::tabularline, - on_off ? Painter::line_onoffdash:Painter::line_solid); + on_off ? LColor::tabularonoffline : LColor::tabularline, + on_off ? Painter::line_onoffdash : Painter::line_solid); } @@ -443,7 +443,7 @@ void InsetTabular::InsetUnlock(BufferView * bv) locked = false; if (scroll() || hasSelection()) { if (scroll()) { - scroll(bv, (float)0.0); + scroll(bv, 0.0F); } else { sel_pos_start = sel_pos_end = 0; sel_cell_start = sel_cell_end = 0; @@ -457,6 +457,7 @@ void InsetTabular::UpdateLocal(BufferView * bv, UpdateCodes what, bool mark_dirty) const { need_update = what; + // Dirty Cast! (Lgb) bv->updateInset(const_cast(this), mark_dirty); if (locked && (what != NONE)) resetPos(bv); @@ -509,11 +510,11 @@ bool InsetTabular::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset, return true; } if (the_locking_inset->UnlockInsetInInset(bv, inset, lr)) { - if ((inset->LyxCode() == TABULAR_CODE) && + if (inset->LyxCode() == TABULAR_CODE && !the_locking_inset->GetFirstLockingInsetOfType(TABULAR_CODE)) { dialogs_ = bv->owner()->getDialogs(); - dialogs_->updateTabular(const_cast(this)); + dialogs_->updateTabular(this); oldcell = actcell; } return true; @@ -574,8 +575,8 @@ void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button) } no_selection = false; - int ocell = actcell; - int orow = actrow; + int const ocell = actcell; + int const orow = actrow; HideInsetCursor(bv); setPos(bv, x, y); @@ -584,10 +585,11 @@ void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button) sel_pos_start = sel_pos_end = cursor.pos(); sel_cell_start = sel_cell_end = actcell; - bool inset_hit = InsetHit(bv, x, y); + bool const inset_hit = InsetHit(bv, x, y); if ((ocell == actcell) && the_locking_inset && inset_hit) { - the_locking_inset->InsetButtonPress(bv, x-inset_x, y-inset_y, button); + the_locking_inset->InsetButtonPress(bv, + x - inset_x, y - inset_y, button); return; } else if (the_locking_inset) { the_locking_inset->InsetUnlock(bv); @@ -595,8 +597,8 @@ void InsetTabular::InsetButtonPress(BufferView * bv, int x, int y, int button) the_locking_inset = 0; if (inset_hit && bv->the_locking_inset) { if (ActivateCellInset(bv, x, y, button)) - the_locking_inset->InsetButtonPress(bv, x-inset_x, - y-inset_y, button); + the_locking_inset->InsetButtonPress(bv, x - inset_x, + y - inset_y, button); return; } ShowInsetCursor(bv); @@ -635,8 +637,8 @@ void InsetTabular::InsetMotionNotify(BufferView * bv, int x, int y, int button) } if (!no_selection) { HideInsetCursor(bv); - int old_pos = sel_pos_end; - int old_cell = actcell; + int const old_pos = sel_pos_end; + int const old_cell = actcell; setPos(bv, x, y); sel_pos_end = cursor.pos(); @@ -752,7 +754,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action, break; case LFUN_DOWNSEL: { - int ocell = actcell; + int const ocell = actcell; moveDown(bv); sel_pos_end = cursor.pos(); if ((ocell == sel_cell_end) || @@ -764,7 +766,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action, } break; case LFUN_DOWN: - result= moveDown(bv); + result = moveDown(bv); sel_pos_start = sel_pos_end = cursor.pos(); sel_cell_start = sel_cell_end = actcell; if (hs) @@ -772,7 +774,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action, break; case LFUN_UPSEL: { - int ocell = actcell; + int const ocell = actcell; moveUp(bv); sel_pos_end = cursor.pos(); if ((ocell == sel_cell_end) || @@ -784,7 +786,7 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action, } break; case LFUN_UP: - result= moveUp(bv); + result = moveUp(bv); sel_pos_start = sel_pos_end = cursor.pos(); sel_cell_start = sel_cell_end = actcell; if (hs) @@ -813,12 +815,22 @@ UpdatableInset::RESULT InsetTabular::LocalDispatch(BufferView * bv, int action, if (hs) UpdateLocal(bv, SELECTION, false); break; +#if 0 case LFUN_LAYOUT_TABLE: { dialogs_ = bv->owner()->getDialogs(); dialogs_->showTabular(this); } break; +#else +#warning Jürgen, have a look. Is this correct? (Lgb) + case LFUN_LAYOUT_TABULAR: + { + dialogs_ = bv->owner()->getDialogs(); + dialogs_->showTabular(this); + } + break; +#endif case LFUN_TABULAR_FEATURE: if (!TabularFeatures(bv, arg)) result = UNDISPATCHED; @@ -954,8 +966,8 @@ void InsetTabular::ToggleInsetCursor(BufferView * bv) LyXFont font; // = the_locking_inset->GetFont(par, cursor.pos); - int asc = lyxfont::maxAscent(font); - int desc = lyxfont::maxDescent(font); + int const asc = lyxfont::maxAscent(font); + int const desc = lyxfont::maxDescent(font); if (cursor_visible) bv->hideLockedInsetCursor(); @@ -970,8 +982,8 @@ void InsetTabular::ShowInsetCursor(BufferView * bv) if (!cursor_visible) { LyXFont font; // = GetFont(par, cursor.pos); - int asc = lyxfont::maxAscent(font); - int desc = lyxfont::maxDescent(font); + int const asc = lyxfont::maxAscent(font); + int const desc = lyxfont::maxDescent(font); bv->fitLockedInsetCursor(cursor.x(), cursor.y(), asc, desc); bv->showLockedInsetCursor(cursor.x(), cursor.y(), asc, desc); cursor_visible = true; @@ -1017,7 +1029,7 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const tabular->GetAdditionalWidth(actcell - 1)); cursor.pos(0); resetPos(bv); - if ((lx - (tabular->GetWidthOfColumn(actcell)/2)) < x) { + if ((lx - (tabular->GetWidthOfColumn(actcell) / 2)) < x) { cursor.x(lx + top_x - 2); cursor.pos(1); } else { @@ -1029,9 +1041,9 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const int InsetTabular::getCellXPos(int cell) const { - int c; + int c = cell; - for(c=cell;!tabular->IsFirstCellInRow(c);--c) + for(; !tabular->IsFirstCellInRow(c); --c) ; int lx = tabular->GetWidthOfColumn(cell); for(; (c < cell); ++c) { @@ -1050,7 +1062,7 @@ void InsetTabular::resetPos(BufferView * bv) const int cell = 0; actrow = 0; cursor.y(0); - for(; (cellIsLastRow(cell); ++cell) { + for(; (cell < actcell) && !tabular->IsLastRow(cell); ++cell) { if (tabular->IsLastCellInRow(cell)) { cursor.y(cursor.y() + tabular->GetDescentOfRow(actrow) + tabular->GetAscentOfRow(actrow + 1) + @@ -1058,7 +1070,7 @@ void InsetTabular::resetPos(BufferView * bv) const ++actrow; } } - static int offset = ADD_TO_TABULAR_WIDTH + 2; + static int const offset = ADD_TO_TABULAR_WIDTH + 2; cursor.x(getCellXPos(actcell) + offset); if (((cursor.x() - offset) > 20) && ((cursor.x()-offset+tabular->GetWidthOfColumn(actcell)) > @@ -1123,7 +1135,7 @@ UpdatableInset::RESULT InsetTabular::moveLeft(BufferView * bv, bool lock) UpdatableInset::RESULT InsetTabular::moveUp(BufferView * bv) { - int ocell = actcell; + int const ocell = actcell; actcell = tabular->GetCellAbove(actcell); if (actcell == ocell) // we moved out of the inset return FINISHED; @@ -1134,7 +1146,7 @@ UpdatableInset::RESULT InsetTabular::moveUp(BufferView * bv) UpdatableInset::RESULT InsetTabular::moveDown(BufferView * bv) { - int ocell = actcell; + int const ocell = actcell; actcell = tabular->GetCellBelow(actcell); if (actcell == ocell) // we moved out of the inset return FINISHED; @@ -1182,15 +1194,17 @@ void InsetTabular::SetFont(BufferView * bv, LyXFont const & font, bool tall) } -bool InsetTabular::TabularFeatures(BufferView * bv, string what) +bool InsetTabular::TabularFeatures(BufferView * bv, string const & what) { int action = LyXTabular::LAST_ACTION; - string val; - int i; - - for(i=0; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) { - if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(), - tabularFeatures[i].feature.length())) { + + int i = 0; + for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) { + string const tmp = tabularFeatures[i].feature; + + if (tmp == what.substr(0, tmp.length())) { + //if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(), + //tabularFeatures[i].feature.length())) { action = tabularFeatures[i].action; break; } @@ -1198,13 +1212,15 @@ bool InsetTabular::TabularFeatures(BufferView * bv, string what) if (action == LyXTabular::LAST_ACTION) return false; - val = frontStrip(what.substr(tabularFeatures[i].feature.length())); + string const val = + frontStrip(what.substr(tabularFeatures[i].feature.length())); TabularFeatures(bv, action, val); return true; } -void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value) +void InsetTabular::TabularFeatures(BufferView * bv, int feature, + string const & value) { int i, j, @@ -1246,7 +1262,6 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value) break; } if (hasSelection()) { - int tmp; sel_col_start = tabular->column_of_cell(sel_cell_start); sel_col_end = tabular->column_of_cell(sel_cell_end); if (sel_col_start > sel_col_end) { @@ -1259,9 +1274,10 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value) sel_row_start = tabular->row_of_cell(sel_cell_start); sel_row_end = tabular->row_of_cell(sel_cell_end); if (sel_row_start > sel_row_end) { - tmp = sel_row_start; - sel_row_start = sel_row_end; - sel_row_end = tmp; + //int tmp = sel_row_start; + //sel_row_start = sel_row_end; + //sel_row_end = tmp; + swap(sel_row_start, sel_row_end); } } else { sel_col_start = sel_col_end = tabular->column_of_cell(actcell); @@ -1284,7 +1300,7 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value) switch (feature) { case LyXTabular::SET_PWIDTH: { - bool update = (tabular->GetColumnPWidth(actcell) != value); + bool const update = (tabular->GetColumnPWidth(actcell) != value); tabular->SetColumnPWidth(actcell,value); if (update) { for (int i=0; i < tabular->rows(); ++i) { @@ -1297,7 +1313,7 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value) break; case LyXTabular::SET_MPWIDTH: { - bool update = (tabular->GetPWidth(actcell) != value); + bool const update = (tabular->GetPWidth(actcell) != value); tabular->SetMColumnPWidth(actcell,value); if (update) { for (int i=0; i < tabular->rows(); ++i) { @@ -1434,8 +1450,8 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value) } // we have a selection so this means we just add all this // cells to form a multicolumn cell - int - s_start, s_end; + int s_start; + int s_end; if (sel_cell_start > sel_cell_end) { s_start = sel_cell_end; @@ -1480,36 +1496,35 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature, string value) tabular->SetRotateCell(tabular->GetCellNumber(i,j),true); break; case LyXTabular::UNSET_ROTATE_CELL: - for(i=sel_row_start; i<=sel_row_end; ++i) - for(j=sel_col_start; j<=sel_col_end; ++j) - tabular->SetRotateCell(tabular->GetCellNumber(i,j),false); + for(i = sel_row_start; i <= sel_row_end; ++i) + for(j = sel_col_start; j <= sel_col_end; ++j) + tabular->SetRotateCell(tabular->GetCellNumber(i, j), false); break; case LyXTabular::SET_USEBOX: { - LyXTabular::BoxType val = static_cast - (strToInt(value)); + LyXTabular::BoxType val = LyXTabular::BoxType(strToInt(value)); if (val == tabular->GetUsebox(actcell)) val = LyXTabular::BOX_NONE; - for(i=sel_row_start; i<=sel_row_end; ++i) - for(j=sel_col_start; j<=sel_col_end; ++j) - tabular->SetUsebox(tabular->GetCellNumber(i,j),val); + for(i = sel_row_start; i <= sel_row_end; ++i) + for(j = sel_col_start; j <= sel_col_end; ++j) + tabular->SetUsebox(tabular->GetCellNumber(i, j), val); break; } case LyXTabular::SET_LTFIRSTHEAD: - tabular->SetLTHead(actcell,true); + tabular->SetLTHead(actcell, true); break; case LyXTabular::SET_LTHEAD: - tabular->SetLTHead(actcell,false); + tabular->SetLTHead(actcell, false); break; case LyXTabular::SET_LTFOOT: - tabular->SetLTFoot(actcell,false); + tabular->SetLTFoot(actcell, false); break; case LyXTabular::SET_LTLASTFOOT: - tabular->SetLTFoot(actcell,true); + tabular->SetLTFoot(actcell, true); break; case LyXTabular::SET_LTNEWPAGE: what = !tabular->GetLTNewPage(actcell); - tabular->SetLTNewPage(actcell,what); + tabular->SetLTNewPage(actcell, what); break; } } @@ -1562,20 +1577,20 @@ bool InsetTabular::InsetHit(BufferView * bv, int x, int ) const // in pixels if we have a pwidth for this cell. int InsetTabular::GetMaxWidthOfCell(Painter &, int cell) const { - string s = tabular->GetPWidth(cell); + string const s = tabular->GetPWidth(cell); if (s.empty()) return -1; - return VSpace(s).inPixels( 0, 0); + return VSpace(s).inPixels(0, 0); } int InsetTabular::getMaxWidth(Painter & pain, UpdatableInset const * inset) const { - int cell; - int n = tabular->GetNumberOfCells(); - for(cell=0; cell < n; ++cell) { + int const n = tabular->GetNumberOfCells(); + int cell = 0; + for(; cell < n; ++cell) { if (tabular->GetCellInset(cell) == inset) break; } @@ -1594,6 +1609,7 @@ void InsetTabular::resizeLyXText(BufferView *) const need_update = FULL; } + LyXText * InsetTabular::getLyXText(BufferView * bv) const { if (the_locking_inset) @@ -1623,16 +1639,17 @@ void InsetTabular::OpenLayoutDialog(BufferView * bv) const // 2 ... toggled on // 3 ... toggled off // -LyXFunc::func_status InsetTabular::getStatus(string what) const +LyXFunc::func_status InsetTabular::getStatus(string const & what) const { int action = LyXTabular::LAST_ACTION; - string argument; - int i; LyXFunc::func_status status = LyXFunc::OK; - for(i=0; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) { - if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(), - tabularFeatures[i].feature.length())) { + int i = 0; + for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) { + string const tmp = tabularFeatures[i].feature; + if (tmp == what.substr(0, tmp.length())) { + //if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(), + // tabularFeatures[i].feature.length())) { action = tabularFeatures[i].action; break; } @@ -1640,20 +1657,20 @@ LyXFunc::func_status InsetTabular::getStatus(string what) const if (action == LyXTabular::LAST_ACTION) return LyXFunc::Unknown; - argument = frontStrip(what.substr(tabularFeatures[i].feature.length())); + string const argument = frontStrip(what.substr(tabularFeatures[i].feature.length())); int sel_row_start, sel_row_end; int dummy; bool flag = true; if (hasSelection()) { - int tmp; sel_row_start = tabular->row_of_cell(sel_cell_start); sel_row_end = tabular->row_of_cell(sel_cell_end); if (sel_row_start > sel_row_end) { - tmp = sel_row_start; - sel_row_start = sel_row_end; - sel_row_end = tmp; + //int tmp = sel_row_start; + //sel_row_start = sel_row_end; + //sel_row_end = tmp; + swap(sel_row_start, sel_row_end); } } else { sel_row_start = sel_row_end = tabular->row_of_cell(actcell); @@ -1864,21 +1881,22 @@ bool InsetTabular::copySelection() sel_row_start = tabular->row_of_cell(sel_cell_start); sel_row_end = tabular->row_of_cell(sel_cell_end); if (sel_row_start > sel_row_end) { - int tmp; - tmp = sel_row_start; - sel_row_start = sel_row_end; - sel_row_end = tmp; + //int tmp tmp = sel_row_start; + //sel_row_start = sel_row_end; + //sel_row_end = tmp; + swap(sel_row_start, sel_row_end); } int rows = sel_row_end - sel_row_start + 1; paste_tabular = new LyXTabular(this, rows, columns); if (sel_cell_start > sel_cell_end) { - int tmp = sel_cell_start; - sel_cell_start = sel_cell_end; - sel_cell_end = tmp; + //int tmp = sel_cell_start; + //sel_cell_start = sel_cell_end; + //sel_cell_end = tmp; + swap(sel_cell_start, sel_cell_end); } - for(int i=sel_cell_start, j=0; i <= sel_cell_end; ++i, ++j) { + for(int i = sel_cell_start, j = 0; i <= sel_cell_end; ++i, ++j) { while(paste_tabular->row_of_cell(j) < (tabular->row_of_cell(i)-sel_row_start)) { ++j; @@ -1933,19 +1951,19 @@ bool InsetTabular::cutSelection() sel_row_start = tabular->row_of_cell(sel_cell_start); sel_row_end = tabular->row_of_cell(sel_cell_end); if (sel_row_start > sel_row_end) { - int tmp; - tmp = sel_row_start; - sel_row_start = sel_row_end; - sel_row_end = tmp; + //int tmp = sel_row_start; + //sel_row_start = sel_row_end; + //sel_row_end = tmp; + swap(sel_row_start, sel_row_end); } if (sel_cell_start > sel_cell_end) { - int tmp = sel_cell_start; - sel_cell_start = sel_cell_end; - sel_cell_end = tmp; + //int tmp = sel_cell_start; + //sel_cell_start = sel_cell_end; + //sel_cell_end = tmp; + swap(sel_cell_start, sel_cell_end); } - int i, j; - for(i=sel_row_start; i <= sel_row_end; ++i) { - for(j=sel_col_start; j <= sel_col_end; ++j) { + for(int i = sel_row_start; i <= sel_row_end; ++i) { + for(int j = sel_col_start; j <= sel_col_end; ++j) { tabular->GetCellInset(tabular->GetCellNumber(i, j))->clear(); } } diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index b37a13e404..64191fa33b 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -149,11 +149,12 @@ public: /// void ToggleInsetCursor(BufferView *); /// - bool TabularFeatures(BufferView * bv, string what); + bool TabularFeatures(BufferView * bv, string const & what); /// - void TabularFeatures(BufferView * bv, int feature, string val = string()); + void TabularFeatures(BufferView * bv, int feature, + string const & val = string()); /// - int GetActCell() { return actcell; } + int GetActCell() const { return actcell; } /// void SetFont(BufferView *, LyXFont const &, bool toggleall = false); /// @@ -162,9 +163,12 @@ public: Buffer * BufferOwner() const { return buffer; } /// LyXText * getLyXText(BufferView *) const; + /// void resizeLyXText(BufferView *) const; + /// void OpenLayoutDialog(BufferView *) const; - LyXFunc::func_status getStatus(string argument) const; + /// + LyXFunc::func_status getStatus(string const & argument) const; // // Public structures and variables @@ -174,7 +178,7 @@ public: private: /// bool calculate_dimensions_of_cells(BufferView *, LyXFont const &, - bool =false) const; + bool = false) const; /// void DrawCellLines(Painter &, int x, int baseline, int row, int cell) const; @@ -208,7 +212,7 @@ private: /// void RemoveTabularRow(); /// - bool hasSelection() const {return ((sel_pos_start != sel_pos_end) || + bool hasSelection() const { return ((sel_pos_start != sel_pos_end) || (sel_cell_start != sel_cell_end));} /// bool ActivateCellInset(BufferView *, int x = 0, int y = 0, int button = 0, diff --git a/src/insets/lyxinset.h b/src/insets/lyxinset.h index 140e7f3778..a894d97511 100644 --- a/src/insets/lyxinset.h +++ b/src/insets/lyxinset.h @@ -107,12 +107,19 @@ public: }; /// - enum { TEXT_TO_INSET_OFFSET = 2 }; + enum { + /// + TEXT_TO_INSET_OFFSET = 2 + }; + /// enum EDITABLE { - NOT_EDITABLE = 0, - IS_EDITABLE, - HIGHLY_EDITABLE + /// + NOT_EDITABLE = 0, + /// + IS_EDITABLE, + /// + HIGHLY_EDITABLE }; /// @@ -198,25 +205,28 @@ public: /// virtual bool InsertInsetAllowed(Inset *) const { return false; } /// - virtual void setInsetName(const char * s) { name = s; } + void setInsetName(string const & s) { name = s; } /// - virtual string getInsetName() const { return name; } + string const getInsetName() const { return name; } /// - virtual void setOwner(Inset * inset) { owner_ = inset; } + void setOwner(Inset * inset) { owner_ = inset; } /// - virtual Inset * owner() const { return owner_; } + Inset * owner() const { return owner_; } /// int x() const { return top_x; } /// int y() const { return top_baseline; } + // + // because we could have fake text insets and have to call this + // inside them without cast!!! /// - /// because we could have fake text insets and have to call this - /// inside them without cast!!! virtual LyXText * getLyXText(BufferView *) const; - virtual void deleteLyXText(BufferView *, bool =true) const {} + /// + virtual void deleteLyXText(BufferView *, bool = true) const {} + /// virtual void resizeLyXText(BufferView *) const {} - // returns the actuall scroll-value - int scroll() const { return scx; } + /// returns the actuall scroll-value + int scroll() const { return scx; } protected: /// diff --git a/src/kbsequence.C b/src/kbsequence.C index 567ff5944e..d5bdd3c3c1 100644 --- a/src/kbsequence.C +++ b/src/kbsequence.C @@ -100,7 +100,7 @@ int kb_sequence::parse(string const & s) { if(s.empty()) return 1; - int i = 0; + string::size_type i = 0; unsigned int mod = 0, nmod = 0; while (i < s.length()) { if(s[i] && (s[i]) <= ' ') ++i; @@ -142,7 +142,7 @@ int kb_sequence::parse(string const & s) } } else { string tbuf; - int j = i; + string::size_type j = i; for(; j < s.length() && s[j] > ' '; ++j) tbuf += s[j]; // (!!!check bounds :-) diff --git a/src/layout_forms.C b/src/layout_forms.C index f128410c9c..3c96d9c089 100644 --- a/src/layout_forms.C +++ b/src/layout_forms.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -9,188 +9,6 @@ #include #include "layout_forms.h" -FD_form_document *create_form_form_document(void) -{ - FL_OBJECT *obj; - FD_form_document *fdui = (FD_form_document *) fl_calloc(1, sizeof(FD_form_document)); - - fdui->form_document = fl_bgn_form(FL_NO_BOX, 580, 430); - obj = fl_add_box(FL_UP_BOX, 0, 0, 580, 430, ""); - fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); - obj = fl_add_frame(FL_ENGRAVED_FRAME, 290, 110, 120, 70, ""); - fl_set_object_color(obj, FL_COL1, FL_COL1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - obj = fl_add_text(FL_NORMAL_TEXT, 300, 100, 100, 20, _("Separation")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_lstyle(obj, FL_BOLD_STYLE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - - fdui->group_radio_separation = fl_bgn_group(); - fdui->radio_indent = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 120, 110, 30, idex(_("Indent|#I")));fl_set_button_shortcut(obj, scex(_("Indent|#I")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->radio_skip = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 150, 110, 30, idex(_("Skip|#K")));fl_set_button_shortcut(obj, scex(_("Skip|#K")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_end_group(); - - fdui->choice_class = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 20, 160, 30, idex(_("Class:|#C")));fl_set_button_shortcut(obj, scex(_("Class:|#C")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, ChoiceClassCB, 0); - fdui->choice_pagestyle = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 60, 160, 30, idex(_("Pagestyle:|#P")));fl_set_button_shortcut(obj, scex(_("Pagestyle:|#P")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->choice_fonts = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 110, 160, 30, idex(_("Fonts:|#F")));fl_set_button_shortcut(obj, scex(_("Fonts:|#F")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->choice_fontsize = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 150, 160, 30, idex(_("Font Size:|#O")));fl_set_button_shortcut(obj, scex(_("Font Size:|#O")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 470, 390, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, DocumentCancelCB, 0); - fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 360, 390, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, DocumentApplyCB, 0); - fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 250, 390, 100, 30, _("OK")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, DocumentOKCB, 0); - fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 450, 195, 120, 30, idex(_("Float Placement:|#L")));fl_set_button_shortcut(obj, scex(_("Float Placement:|#L")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->choice_postscript_driver = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 230, 190, 30, idex(_("PS Driver:|#S")));fl_set_button_shortcut(obj, scex(_("PS Driver:|#S")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->choice_inputenc = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 270, 190, 30, idex(_("Encoding:|#D")));fl_set_button_shortcut(obj, scex(_("Encoding:|#D")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - obj = fl_add_frame(FL_ENGRAVED_FRAME, 290, 20, 122, 70, ""); - fl_set_object_color(obj, FL_COL1, FL_COL1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - obj = fl_add_frame(FL_ENGRAVED_FRAME, 432, 20, 136, 70, ""); - fl_set_object_color(obj, FL_COL1, FL_COL1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - - fdui->group_radio_sides = fl_bgn_group(); - fdui->radio_sides_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 30, 120, 30, idex(_("One|#n")));fl_set_button_shortcut(obj, scex(_("One|#n")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->radio_sides_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 60, 120, 30, idex(_("Two|#T")));fl_set_button_shortcut(obj, scex(_("Two|#T")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_end_group(); - - obj = fl_add_text(FL_NORMAL_TEXT, 300, 10, 60, 20, _("Sides")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_lstyle(obj, FL_BOLD_STYLE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - obj = fl_add_text(FL_NORMAL_TEXT, 440, 10, 80, 20, _("Columns")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_lstyle(obj, FL_BOLD_STYLE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - - fdui->group_radio_columns = fl_bgn_group(); - fdui->radio_columns_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 432, 30, 110, 30, idex(_("One|#e")));fl_set_button_shortcut(obj, scex(_("One|#e")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->radio_columns_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 432, 60, 110, 30, idex(_("Two|#w")));fl_set_button_shortcut(obj, scex(_("Two|#w")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_end_group(); - - fdui->input_extra = obj = fl_add_input(FL_NORMAL_INPUT, 450, 235, 120, 30, idex(_("Extra Options:|#X")));fl_set_button_shortcut(obj, scex(_("Extra Options:|#X")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->choice_language = obj = fl_add_box(FL_FRAME_BOX, 120, 190, 190, 30, _("Language:")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->input_default_skip = obj = fl_add_input(FL_NORMAL_INPUT, 220, 310, 90, 30, ""); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, DocumentDefskipCB, 0); - fdui->choice_default_skip = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 310, 90, 30, idex(_("Default Skip:|#u")));fl_set_button_shortcut(obj, scex(_("Default Skip:|#u")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, DocumentDefskipCB, 0); - fdui->slider_secnumdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 490, 275, 80, 30, _("Section number depth")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->slider_tocdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 490, 315, 80, 30, _("Table of contents depth")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->choice_spacing = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 350, 120, 30, idex(_("Spacing|#g")));fl_set_button_shortcut(obj, scex(_("Spacing|#g")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, DocumentSpacingCB, 0); - fdui->button_bullets = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 110, 130, 30, idex(_("Bullet Shapes|#B")));fl_set_button_shortcut(obj, scex(_("Bullet Shapes|#B")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, DocumentBulletsCB, 0); - fdui->check_use_amsmath = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 430, 145, 120, 30, idex(_("Use AMS Math|#M")));fl_set_button_shortcut(obj, scex(_("Use AMS Math|#M")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fdui->input_spacing = obj = fl_add_input(FL_FLOAT_INPUT, 250, 350, 95, 30, ""); - fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); - fl_set_object_resize(obj, FL_RESIZE_NONE); - fl_set_object_callback(obj, DocumentSpacingCB, 0); - fl_end_form(); - - //fdui->form_document->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - FD_form_character *create_form_form_character(void) { FL_OBJECT *obj; @@ -266,113 +84,7 @@ FD_form_character *create_form_form_character(void) fl_set_object_resize(obj, FL_RESIZE_X); fl_end_form(); - //fdui->form_character->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - -FD_form_paragraph *create_form_form_paragraph(void) -{ - FL_OBJECT *obj; - FD_form_paragraph *fdui = (FD_form_paragraph *) fl_calloc(1, sizeof(FD_form_paragraph)); - - fdui->form_paragraph = fl_bgn_form(FL_NO_BOX, 490, 290); - obj = fl_add_box(FL_UP_BOX, 0, 0, 490, 290, ""); - fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 127, 250, 100, 30, _("OK")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, ParagraphOKCB, 0); - fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 244, 250, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, ParagraphApplyCB, 0); - fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 360, 250, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, ParagraphCancelCB, 0); - obj = fl_add_frame(FL_ENGRAVED_FRAME, 360, 110, 120, 50, ""); - fl_set_object_color(obj, FL_COL1, FL_COL1); - obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 110, 340, 90, ""); - fl_set_object_color(obj, FL_COL1, FL_COL1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - obj = fl_add_frame(FL_ENGRAVED_FRAME, 360, 20, 120, 70, ""); - fl_set_object_color(obj, FL_COL1, FL_COL1); - obj = fl_add_frame(FL_ENGRAVED_FRAME, 210, 20, 140, 70, ""); - fl_set_object_color(obj, FL_COL1, FL_COL1); - obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 190, 70, ""); - fl_set_object_color(obj, FL_COL1, FL_COL1); - fdui->input_labelwidth = obj = fl_add_input(FL_NORMAL_INPUT, 100, 210, 360, 30, idex(_("Label Width:|#d")));fl_set_button_shortcut(obj, scex(_("Label Width:|#d")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_West, FL_East); - fl_set_object_resize(obj, FL_RESIZE_X); - obj = fl_add_text(FL_NORMAL_TEXT, 370, 100, 60, 20, _("Indent")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_lstyle(obj, FL_BOLD_STYLE); - fdui->check_lines_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 30, 120, 30, idex(_("Above|#b")));fl_set_button_shortcut(obj, scex(_("Above|#b")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fdui->check_lines_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 60, 120, 30, idex(_("Below|#E")));fl_set_button_shortcut(obj, scex(_("Below|#E")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fdui->check_pagebreaks_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 30, 120, 30, idex(_("Above|#o")));fl_set_button_shortcut(obj, scex(_("Above|#o")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fdui->check_pagebreaks_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 60, 120, 30, idex(_("Below|#l")));fl_set_button_shortcut(obj, scex(_("Below|#l")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fdui->check_noindent = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 120, 120, 30, idex(_("No Indent|#I")));fl_set_button_shortcut(obj, scex(_("No Indent|#I")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - - fdui->group_radio_alignment = fl_bgn_group(); - fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 30, 80, 30, idex(_("Right|#R")));fl_set_button_shortcut(obj, scex(_("Right|#R")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 80, 30, idex(_("Left|#f")));fl_set_button_shortcut(obj, scex(_("Left|#f")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fdui->radio_align_block = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 100, 30, 80, 30, idex(_("Block|#c")));fl_set_button_shortcut(obj, scex(_("Block|#c")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 100, 60, 80, 30, idex(_("Center|#n")));fl_set_button_shortcut(obj, scex(_("Center|#n")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_end_group(); - - fdui->input_space_above = obj = fl_add_input(FL_NORMAL_INPUT, 180, 120, 90, 30, ""); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, ParagraphVSpaceCB, 0); - fdui->input_space_below = obj = fl_add_input(FL_NORMAL_INPUT, 180, 160, 90, 30, ""); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, ParagraphVSpaceCB, 0); - fdui->choice_space_above = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 120, 100, 30, idex(_("Above:|#v")));fl_set_button_shortcut(obj, scex(_("Above:|#v")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, ParagraphVSpaceCB, 0); - fdui->choice_space_below = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 160, 100, 30, idex(_("Below:|#w")));fl_set_button_shortcut(obj, scex(_("Below:|#w")), 1); - fl_set_object_boxtype(obj, FL_FRAME_BOX); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, ParagraphVSpaceCB, 0); - obj = fl_add_text(FL_NORMAL_TEXT, 370, 10, 100, 20, _("Pagebreaks")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_lstyle(obj, FL_BOLD_STYLE); - obj = fl_add_text(FL_NORMAL_TEXT, 230, 10, 50, 20, _("Lines")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_lstyle(obj, FL_BOLD_STYLE); - obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 80, 20, _("Alignment")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_lstyle(obj, FL_BOLD_STYLE); - obj = fl_add_text(FL_NORMAL_TEXT, 20, 100, 130, 20, _("Vertical Spaces")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); - fl_set_object_lstyle(obj, FL_BOLD_STYLE); - fdui->button_pextra = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 250, 100, 30, idex(_("ExtraOpt|#X")));fl_set_button_shortcut(obj, scex(_("ExtraOpt|#X")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, ParagraphExtraOpen, 0); - fdui->check_space_above = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 270, 120, 40, 30, idex(_("Keep|#K")));fl_set_button_shortcut(obj, scex(_("Keep|#K")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fdui->check_space_below = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 270, 160, 40, 30, idex(_("Keep|#p")));fl_set_button_shortcut(obj, scex(_("Keep|#p")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_end_form(); - - //fdui->form_paragraph->fdui = fdui; + fdui->form_character->fdui = fdui; return fdui; } @@ -402,418 +114,9 @@ FD_form_preamble *create_form_form_preamble(void) fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); fl_end_form(); - //fdui->form_preamble->fdui = fdui; - - 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; + fdui->form_preamble->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 diff --git a/src/layout_forms.h b/src/layout_forms.h index aaa4123446..5dba3e9db5 100644 --- a/src/layout_forms.h +++ b/src/layout_forms.h @@ -1,123 +1,21 @@ /** Header file generated with fdesign **/ -#ifndef FD_form_document_h_ -#define FD_form_document_h_ - -extern "C" { +#ifndef FD_form_character_h_ +#define FD_form_character_h_ /** Callbacks, globals and object handlers **/ -extern "C" void ChoiceClassCB(FL_OBJECT *, long); -extern "C" void DocumentCancelCB(FL_OBJECT *, long); -extern "C" void DocumentApplyCB(FL_OBJECT *, long); -extern "C" void DocumentOKCB(FL_OBJECT *, long); -extern "C" void DocumentDefskipCB(FL_OBJECT *, long); -extern "C" void DocumentSpacingCB(FL_OBJECT *, long); -extern "C" void DocumentBulletsCB(FL_OBJECT *, long); - extern "C" void CharacterApplyCB(FL_OBJECT *, long); extern "C" void CharacterCloseCB(FL_OBJECT *, long); -extern "C" void ParagraphOKCB(FL_OBJECT *, long); -extern "C" void ParagraphApplyCB(FL_OBJECT *, long); -extern "C" void ParagraphCancelCB(FL_OBJECT *, long); -extern "C" void ParagraphVSpaceCB(FL_OBJECT *, long); -extern "C" void ParagraphExtraOpen(FL_OBJECT *, long); - extern "C" void PreambleOKCB(FL_OBJECT *, long); extern "C" void PreambleApplyCB(FL_OBJECT *, long); extern "C" void PreambleCancelCB(FL_OBJECT *, long); -extern "C" void QuotesOKCB(FL_OBJECT *, long); -extern "C" void QuotesApplyCB(FL_OBJECT *, long); -extern "C" void QuotesCancelCB(FL_OBJECT *, long); - -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 - -} +/* Some extra funcs */ -/* Additional Functions/Methods */ - -#include "bufferparams.h" - -extern bool UpdateLayoutDocument(BufferParams *params = NULL); extern bool UpdateLayoutPreamble(); -extern bool UpdateLayoutPaper(); -extern bool UpdateLayoutQuotes(); -extern bool UpdateLayoutParagraph(); -extern bool UpdateParagraphExtra(); -#if 0 -extern bool UpdateLayoutTable(int); -#endif - -extern void MenuLayoutCharacter(); -extern void MenuLayoutDocument(); -extern void MenuLayoutPreamble(); -extern void MenuLayoutPaper(); -extern void MenuLayoutQuotes(); -extern void MenuLayoutParagraph(); -#if 0 -extern void MenuLayoutTable(int); -#endif - -extern "C" { /**** Forms and Objects ****/ -typedef struct { - FL_FORM *form_document; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *group_radio_separation; - FL_OBJECT *radio_indent; - FL_OBJECT *radio_skip; - FL_OBJECT *choice_class; - FL_OBJECT *choice_pagestyle; - FL_OBJECT *choice_fonts; - FL_OBJECT *choice_fontsize; - FL_OBJECT *button_cancel; - FL_OBJECT *button_apply; - FL_OBJECT *button_ok; - FL_OBJECT *input_float_placement; - FL_OBJECT *choice_postscript_driver; - FL_OBJECT *choice_inputenc; - FL_OBJECT *group_radio_sides; - FL_OBJECT *radio_sides_one; - FL_OBJECT *radio_sides_two; - FL_OBJECT *group_radio_columns; - FL_OBJECT *radio_columns_one; - FL_OBJECT *radio_columns_two; - FL_OBJECT *input_extra; - FL_OBJECT *choice_language; - FL_OBJECT *input_default_skip; - FL_OBJECT *choice_default_skip; - FL_OBJECT *slider_secnumdepth; - FL_OBJECT *slider_tocdepth; - FL_OBJECT *choice_spacing; - FL_OBJECT *button_bullets; - FL_OBJECT *check_use_amsmath; - FL_OBJECT *input_spacing; -} FD_form_document; - -extern FD_form_document * create_form_form_document(void); typedef struct { FL_FORM *form_character; void *vdata; @@ -136,35 +34,6 @@ typedef struct { } FD_form_character; extern FD_form_character * create_form_form_character(void); -typedef struct { - FL_FORM *form_paragraph; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *button_ok; - FL_OBJECT *button_apply; - FL_OBJECT *button_cancel; - FL_OBJECT *input_labelwidth; - FL_OBJECT *check_lines_top; - FL_OBJECT *check_lines_bottom; - FL_OBJECT *check_pagebreaks_top; - FL_OBJECT *check_pagebreaks_bottom; - FL_OBJECT *check_noindent; - FL_OBJECT *group_radio_alignment; - FL_OBJECT *radio_align_right; - FL_OBJECT *radio_align_left; - FL_OBJECT *radio_align_block; - FL_OBJECT *radio_align_center; - FL_OBJECT *input_space_above; - FL_OBJECT *input_space_below; - FL_OBJECT *choice_space_above; - FL_OBJECT *choice_space_below; - FL_OBJECT *button_pextra; - FL_OBJECT *check_space_above; - FL_OBJECT *check_space_below; -} FD_form_paragraph; - -extern FD_form_paragraph * create_form_form_paragraph(void); typedef struct { FL_FORM *form_preamble; void *vdata; @@ -177,118 +46,5 @@ typedef struct { } FD_form_preamble; extern FD_form_preamble * create_form_form_preamble(void); -typedef struct { - FL_FORM *form_quotes; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *choice_quotes_language; - FL_OBJECT *group_radio_quotes_number; - FL_OBJECT *radio_single; - FL_OBJECT *radio_double; -} FD_form_quotes; - -extern FD_form_quotes * create_form_form_quotes(void); -typedef struct { - FL_FORM *form_paper; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *choice_paperpackage; - FL_OBJECT *button_cancel; - FL_OBJECT *button_apply; - FL_OBJECT *button_ok; - FL_OBJECT *greoup_radio_orientation; - FL_OBJECT *radio_portrait; - FL_OBJECT *radio_landscape; - FL_OBJECT *choice_papersize2; - FL_OBJECT *push_use_geometry; - FL_OBJECT *input_custom_width; - FL_OBJECT *input_custom_height; - FL_OBJECT *input_top_margin; - FL_OBJECT *input_bottom_margin; - FL_OBJECT *input_left_margin; - FL_OBJECT *input_right_margin; - FL_OBJECT *input_head_height; - FL_OBJECT *input_head_sep; - FL_OBJECT *input_foot_skip; - FL_OBJECT *text_warning; -} FD_form_paper; - -extern FD_form_paper * create_form_form_paper(void); -typedef struct { - FL_FORM *form_table_options; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *text_warning; - FL_OBJECT *button_close; - FL_OBJECT *radio_border_top; - FL_OBJECT *radio_border_bottom; - FL_OBJECT *radio_border_left; - FL_OBJECT *radio_border_right; - FL_OBJECT *radio_multicolumn; - FL_OBJECT *button_append_column; - FL_OBJECT *button_delete_column; - FL_OBJECT *button_append_row; - FL_OBJECT *button_delete_row; - FL_OBJECT *button_table_delete; - FL_OBJECT *input_table_column; - FL_OBJECT *input_table_row; - FL_OBJECT *button_set_borders; - FL_OBJECT *button_unset_borders; - FL_OBJECT *radio_longtable; - FL_OBJECT *input_column_width; - FL_OBJECT *radio_rotate_table; - FL_OBJECT *radio_linebreak_cell; - FL_OBJECT *radio_lt_firsthead; - FL_OBJECT *radio_lt_head; - FL_OBJECT *radio_lt_foot; - FL_OBJECT *radio_lt_lastfoot; - FL_OBJECT *radio_lt_newpage; - FL_OBJECT *radio_rotate_cell; - FL_OBJECT *button_table_extra; - FL_OBJECT *radio_align_left; - FL_OBJECT *radio_align_right; - FL_OBJECT *radio_align_center; -} FD_form_table_options; - -extern FD_form_table_options * create_form_form_table_options(void); -typedef struct { - FL_FORM *form_paragraph_extra; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *input_pextra_width; - FL_OBJECT *button_ok; - FL_OBJECT *button_apply; - FL_OBJECT *button_cancel; - FL_OBJECT *input_pextra_widthp; - FL_OBJECT *group_alignment; - FL_OBJECT *radio_pextra_top; - FL_OBJECT *radio_pextra_middle; - FL_OBJECT *radio_pextra_bottom; - FL_OBJECT *text_warning; - FL_OBJECT *radio_pextra_hfill; - FL_OBJECT *radio_pextra_startmp; - FL_OBJECT *group_extraopt; - FL_OBJECT *radio_pextra_indent; - FL_OBJECT *radio_pextra_minipage; - FL_OBJECT *radio_pextra_floatflt; -} FD_form_paragraph_extra; - -extern FD_form_paragraph_extra * create_form_form_paragraph_extra(void); -typedef struct { - FL_FORM *form_table_extra; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *input_special_alignment; - FL_OBJECT *input_special_multialign; -} FD_form_table_extra; - -extern FD_form_table_extra * create_form_form_table_extra(void); - -} -#endif /* FD_form_document_h_ */ +#endif /* FD_form_character_h_ */ diff --git a/src/log_form.C b/src/log_form.C index d87147fd1a..bdf00bc8b0 100644 --- a/src/log_form.C +++ b/src/log_form.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -28,7 +28,7 @@ FD_LaTeXLog *create_form_LaTeXLog(void) fl_set_object_callback(obj, LatexLogUpdate, 0); fl_end_form(); - //fdui->LaTeXLog->fdui = fdui; + fdui->LaTeXLog->fdui = fdui; return fdui; } diff --git a/src/lyx.C b/src/lyx.C index 6e0542eb3e..8bf911377a 100644 --- a/src/lyx.C +++ b/src/lyx.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -21,7 +21,7 @@ FD_form_title *create_form_form_title(void) fl_set_object_callback(obj, TimerCB, 0); fl_end_form(); - //fdui->form_title->fdui = fdui; + fdui->form_title->fdui = fdui; return fdui; } @@ -59,7 +59,7 @@ FD_form_figure *create_form_form_figure(void) fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_end_form(); - //fdui->form_figure->fdui = fdui; + fdui->form_figure->fdui = fdui; return fdui; } @@ -116,7 +116,7 @@ FD_form_external *create_form_form_external(void) fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); fl_end_form(); - //fdui->form_external->fdui = fdui; + fdui->form_external->fdui = fdui; return fdui; } diff --git a/src/lyx_cb.C b/src/lyx_cb.C index d767737d2c..84550020d5 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -17,7 +17,6 @@ #include FORMS_H_LOCATION #include "lyx.h" #include "layout_forms.h" -#include "bullet_forms.h" #include "form1.h" #include "lyx_main.h" #include "lyx_cb.h" @@ -61,14 +60,9 @@ extern Combox * combo_language2; extern BufferList bufferlist; extern void show_symbols_form(); extern FD_form_title * fd_form_title; -extern FD_form_paragraph * fd_form_paragraph; extern FD_form_character * fd_form_character; -extern FD_form_document * fd_form_document; -extern FD_form_quotes * fd_form_quotes; extern FD_form_preamble * fd_form_preamble; -extern FD_form_table * fd_form_table; extern FD_form_figure * fd_form_figure; -extern FD_form_bullet * fd_form_bullet; extern BufferView * current_view; // called too many times in this file... @@ -297,36 +291,6 @@ bool MenuWriteAs(Buffer * buffer) return true; } -#ifndef NEW_EXPORT -int MenuRunLaTeX(Buffer * buffer) -{ - int ret = 0; - - if (buffer->isLinuxDoc()) - ret = RunLinuxDoc(buffer->getUser(), 1, buffer->fileName()); - else if (buffer->isLiterate()) - ret = buffer->runLiterate(); - else if (buffer->isDocBook()) - ret = RunDocBook(1, buffer->fileName()); - else - ret = buffer->runLaTeX(); - - if (ret > 0) { - string s; - string t; - if (ret == 1) { - s = _("One error detected"); - t = _("You should try to fix it."); - } else { - s += tostr(ret); - s += _(" errors detected."); - t = _("You should try to fix them."); - } - WriteAlert(_("There were errors during the LaTeX run."), s, t); - } - return ret; -} -#endif int MenuBuildProg(Buffer * buffer) { @@ -388,245 +352,17 @@ int MenuRunChktex(Buffer * buffer) return ret; } -#ifndef NEW_EXPORT -int MakeLaTeXOutput(Buffer * buffer) -{ - // Who cares? - //if (!bv->text) - // return 1; - int ret = 0; - string path = OnlyPath(buffer->fileName()); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { - path = buffer->tmppath; - } - - Path p(path); - ret = MenuRunLaTeX(buffer); - - return ret; -} - - -/* wait == false means don't wait for termination */ -/* wait == true means wait for termination */ -// The bool should be placed last on the argument line. (Lgb) -// Returns false if we fail. -bool RunScript(Buffer * buffer, bool wait, - string const & command, - string const & orgname = string(), - bool need_shell = true) -{ - string path; - string cmd; - string name = orgname; - int result = 0; - - if (MakeLaTeXOutput(buffer) > 0) - return false; - /* get DVI-Filename */ - if (name.empty()) - name = ChangeExtension(buffer->getLatexName(), ".dvi"); - - path = OnlyPath(name); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { - path = buffer->tmppath; - } - Path p(path); - // At this point we check whether the command contains the - // filename parameter $$FName and if that's the case we - // substitute the real file name otherwise the filename is - // simply appended. rokrau 1/12/00 - cmd = command; - string::size_type i; - if ( (i=command.find("$$FName")) != string::npos) - { - cmd.replace(i,7,QuoteName(name)); - } - else - cmd = command + ' ' + QuoteName(name); - - Systemcalls one; - - if (need_shell) { -#ifndef __EMX__ - if (!wait) - cmd += " &"; -#else - // OS/2 cmd.exe has another use for '&' - if (!wait) { - // This is not NLS safe, but it's OK, I think. - string sh = OnlyFilename(GetEnvPath("EMXSHELL")); - if (sh.empty()) { - // COMSPEC is set, unless user unsets - sh = OnlyFilename(GetEnvPath("COMSPEC")); - if (sh.empty()) - sh = "cmd.exe"; - } - sh = lowercase(sh); - if (contains(sh, "cmd.exe") - || contains(sh, "4os2.exe")) - cmd = "start /min/n " + cmd; - else - cmd += " &"; - } -#endif - // It seems that, if wait is false, we never get back - // the return code of the command. This means that all - // the code I added in PrintApplyCB is currently - // useless... - // CHECK What should we do here? - ShowMessage(buffer, _("Executing command:"), cmd); - result = one.startscript(Systemcalls::System, cmd); - } else { - ShowMessage(buffer, _("Executing command:"), cmd); - result = one.startscript(wait ? Systemcalls::Wait - : Systemcalls::DontWait, cmd); - } - return result == 0; -} - - -// Returns false if we fail -bool CreatePostscript(Buffer * buffer, bool wait = false) -{ - // Who cares? - //if (!bv->text) - // return false; - - ProhibitInput(current_view); - - // Generate dvi file - if (MakeLaTeXOutput(buffer) > 0) { - AllowInput(current_view); - return false; - } - // Generate postscript file - string psname = OnlyFilename(ChangeExtension (buffer->fileName(), - ".ps_tmp")); - - string paper; - - // Wrong type - char real_papersize = buffer->params.papersize; - if (real_papersize == BufferParams::PAPER_DEFAULT) - real_papersize = lyxrc.default_papersize; - - switch (real_papersize) { - case BufferParams::PAPER_USLETTER: - paper = "letter"; - break; - case BufferParams::PAPER_A3PAPER: - paper = "a3"; - break; - case BufferParams::PAPER_A4PAPER: - paper = "a4"; - break; - case BufferParams::PAPER_A5PAPER: - paper = "a5"; - break; - case BufferParams::PAPER_B5PAPER: - paper = "b5"; - break; - case BufferParams::PAPER_EXECUTIVEPAPER: - paper = "foolscap"; - break; - case BufferParams::PAPER_LEGALPAPER: - paper = "legal"; - break; - default: /* If nothing else fits, keep an empty value... */ - break; - } - - // Make postscript file. - string command = lyxrc.dvi_to_ps_command + ' ' + lyxrc.print_to_file + ' '; - command += QuoteName(psname); - if (buffer->params.use_geometry - && buffer->params.papersize2 == BufferParams::VM_PAPER_CUSTOM - && !lyxrc.print_paper_dimension_flag.empty() - && !buffer->params.paperwidth.empty() - && !buffer->params.paperheight.empty()) { - // using a custom papersize - command += ' '; - command += lyxrc.print_paper_dimension_flag + ' '; - command += buffer->params.paperwidth + ','; - command += buffer->params.paperheight; - } else if (!paper.empty() - && (real_papersize != BufferParams::PAPER_USLETTER || - buffer->params.orientation == BufferParams::ORIENTATION_PORTRAIT)) { - // dvips won't accept -t letter -t landscape. In all other - // cases, include the paper size explicitly. - command += ' '; - command += lyxrc.print_paper_flag + ' ' + paper; - } - if (buffer->params.orientation == BufferParams::ORIENTATION_LANDSCAPE) { - command += ' '; - command += lyxrc.print_landscape_flag; - } - // push directorypath, if necessary - string path = OnlyPath(buffer->fileName()); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)){ - path = buffer->tmppath; - } - Path p(path); - bool ret = RunScript(buffer, wait, command); - AllowInput(current_view); - return ret; -} - - -// Returns false if we fail -//bool MenuPreviewPS(Buffer * buffer) -bool PreviewPostscript(Buffer * buffer) -{ - // Who cares? - //if (!bv->text) - // return false; - - // Generate postscript file - if (!CreatePostscript(buffer, true)) { - return false; - } - - // Start postscript viewer - ProhibitInput(current_view); - string ps = OnlyFilename(ChangeExtension (buffer->fileName(), - ".ps_tmp")); - // push directorypath, if necessary - string path = OnlyPath(buffer->fileName()); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)){ - path = buffer->tmppath; - } - Path p(path); - bool ret = RunScript(buffer, false, lyxrc.view_ps_command, ps); - AllowInput(current_view); - return ret; -} -#endif void MenuFax(Buffer * buffer) { - // Who cares? - //if (!bv->text) - // return; - -#ifdef NEW_EXPORT // Generate postscript file if (!Exporter::Export(buffer, "ps", true)) return; // Send fax - string ps = OnlyFilename(ChangeExtension (buffer->fileName(), - ".ps")); -#else - // Generate postscript file - if (!CreatePostscript(buffer, true)) { - return; - } + string const ps = OnlyFilename(ChangeExtension(buffer->fileName(), + ".ps")); - // Send fax - string ps = OnlyFilename(ChangeExtension (buffer->fileName(), - ".ps_tmp")); -#endif string path = OnlyPath (buffer->fileName()); if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { path = buffer->tmppath; @@ -641,331 +377,6 @@ void MenuFax(Buffer * buffer) } -#ifndef NEW_EXPORT -// Returns false if we fail -bool PreviewDVI(Buffer * buffer) -{ - // Who cares? - //if (!bv->text) - // return false; - - string paper = lyxrc.view_dvi_paper_option; - if (!paper.empty()) { - // wrong type - char real_papersize = buffer->params.papersize; - if (real_papersize == BufferParams::PAPER_DEFAULT) - real_papersize = lyxrc.default_papersize; - - switch (real_papersize) { - case BufferParams::PAPER_USLETTER: - paper += " us"; - break; - case BufferParams::PAPER_A3PAPER: - paper += " a3"; - break; - case BufferParams::PAPER_A4PAPER: - paper += " a4"; - break; - case BufferParams::PAPER_A5PAPER: - paper += " a5"; - break; - case BufferParams::PAPER_B5PAPER: - paper += " b5"; - break; - case BufferParams::PAPER_EXECUTIVEPAPER: - paper += " foolscap"; - break; - case BufferParams::PAPER_LEGALPAPER: - paper += " legal"; - break; - default: /* If nothing else fits, keep the empty value */ - break; - } - if (real_papersize==' ') { - // if (paper.empty()) { - if (buffer->params.orientation - == BufferParams::ORIENTATION_LANDSCAPE) - // we HAVE to give a size when the page is in - // landscape, so use USletter. - paper = " -paper usr"; - } else { - // paper = " -paper " + paper; - if (buffer->params.orientation - == BufferParams::ORIENTATION_LANDSCAPE) - paper+= 'r'; - } - } - // push directorypath, if necessary - string path = OnlyPath(buffer->fileName()); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { - path = buffer->tmppath; - } - Path p(path); - // Run dvi-viewer - string command = lyxrc.view_dvi_command + " " + paper; - bool ret = RunScript(buffer, false, command); - return ret; -} - - -bool AskOverwrite(Buffer * buffer, string const & s) -{ - if (lyxrc.use_gui) { - // be friendly if there is a gui - FileInfo fi(s); - if (fi.readable() && - !AskQuestion(_("File already exists:"), - MakeDisplayPath(s, 50), - _("Do you want to overwrite the file?"))) { - ShowMessage(buffer, _("Canceled")); - return false; - } - } - return true; -} - - -void MenuMakeLaTeX(Buffer * buffer) -{ - // Why care about this? - //if (!bv->text) - // return; - - // Get LaTeX-Filename - string s = buffer->getLatexName(false); - - if (!AskOverwrite(buffer, s)) - return; - - if (buffer->isDocBook()) - ShowMessage(buffer, _("DocBook does not have a latex backend")); - else { - if (buffer->isLinuxDoc()) - RunLinuxDoc(buffer->getUser(), 0, buffer->fileName()); - else - buffer->makeLaTeXFile(s, string(), true); - ShowMessage(buffer, _("Nice LaTeX file saved as"), - MakeDisplayPath(s)); - } -} - - -void MenuMakeLinuxDoc(Buffer * buffer) -{ - // Who cares? - //if (!bv->text) return; - - if (!buffer->isLinuxDoc()) { - WriteAlert(_("Error!"), _("Document class must be linuxdoc.")); - return; - } - - // Get LinuxDoc-Filename - string s = ChangeExtension(buffer->fileName(), ".sgml"); - - if (!AskOverwrite(buffer, s)) - return; - - ShowMessage(buffer, _("Building LinuxDoc SGML file `"), - MakeDisplayPath(s),"'..."); - - buffer->makeLinuxDocFile(s, true); - buffer->redraw(); - ShowMessage(buffer, _("LinuxDoc SGML file save as"), - MakeDisplayPath(s)); -} - - -void MenuMakeDocBook(Buffer * buffer) -{ - // Who cares? - //if (!bv->text) return; - - if (!buffer->isDocBook()) { - WriteAlert(_("Error!"), - _("Document class must be docbook.")); - return; - } - - // Get DocBook-Filename - string s = ChangeExtension(buffer->fileName(), ".sgml"); - - if (!AskOverwrite(buffer, s)) - return; - - ShowMessage(buffer, _("Building DocBook SGML file `"), - MakeDisplayPath(s), "'..."); - - buffer->makeDocBookFile(s, true); - buffer->redraw(); - ShowMessage(buffer, _("DocBook SGML file save as"), - MakeDisplayPath(s)); -} - - -void MenuMakeAscii(Buffer * buffer) -{ - // Who cares? - //if (!bv->text) return; - - /* get LaTeX-Filename */ - string s = ChangeExtension (buffer->fileName(), ".txt"); - - - if (!AskOverwrite(buffer, s)) - return; - - buffer->writeFileAscii(s, lyxrc.ascii_linelen); - - ShowMessage(buffer, _("Ascii file saved as"), MakeDisplayPath(s)); -} - - -void MenuMakeHTML(Buffer * buffer) -{ - // First, create LaTeX file - MenuMakeLaTeX(buffer); - - // And now, run the converter - string file = buffer->fileName(); - Path path(OnlyPath(file)); - // the tex file name has to be correct for - // latex, but the html file name can be - // anything. - string result = ChangeExtension(file, ".html"); - string infile = buffer->getLatexName(false); - string tmp = lyxrc.html_command; - tmp = subst(tmp, "$$FName", infile); - tmp = subst(tmp, "$$OutName", result); - Systemcalls one; - int res = one.startscript(Systemcalls::System, tmp); - if (res == 0) { - ShowMessage(buffer, _("Document exported as HTML to file `") - + MakeDisplayPath(result) +'\''); - } else { - ShowMessage(buffer, _("Unable to convert to HTML the file `") - + MakeDisplayPath(infile) - + '\''); - } - -} - - -void MenuMakeHTML_LinuxDoc(Buffer * buffer) -{ - // First, create LinuxDoc file - MenuMakeLinuxDoc(buffer); - - // And now, run the converter - string file = buffer->fileName(); - - string result = ChangeExtension(file, ".html"); - string infile = ChangeExtension(file, ".sgml"); - string tmp = lyxrc.linuxdoc_to_html_command; - tmp = subst(tmp, "$$FName", infile); - tmp = subst(tmp, "$$OutName", result); - Systemcalls one; - int res = one.startscript(Systemcalls::System, tmp); - if (res == 0) { - ShowMessage(buffer,_("Document exported as HTML to file `") - + MakeDisplayPath(result) +'\''); - } else { - ShowMessage(buffer,_("Unable to convert to HTML the file `") - + MakeDisplayPath(infile) - + '\''); - } - -} - -void MenuMakeHTML_DocBook(Buffer * buffer) -{ - // First, create LaTeX file - MenuMakeDocBook(buffer); - - // And now, run the converter - string file = buffer->fileName(); - string result = ChangeExtension(file, ".html"); - string infile = ChangeExtension(file, ".sgml"); - string tmp = lyxrc.docbook_to_html_command; - tmp = subst(tmp, "$$FName", infile); - tmp = subst(tmp, "$$OutName", result); - Systemcalls one; - int res = one.startscript(Systemcalls::System, tmp); - if (res == 0) { - ShowMessage(buffer,_("Document exported as HTML to file `") - + MakeDisplayPath(result) +'\''); - } else { - ShowMessage(buffer,_("Unable to convert to HTML the file `") - + MakeDisplayPath(infile) - + '\''); - } - -} - - -void MenuExport(Buffer * buffer, string const & extyp) -{ - // latex - if (extyp == "latex") { - // make sure that this buffer is not linuxdoc - MenuMakeLaTeX(buffer); - } - // linuxdoc - else if (extyp == "linuxdoc") { - // make sure that this buffer is not latex - MenuMakeLinuxDoc(buffer); - } - // docbook - else if (extyp == "docbook") { - // make sure that this buffer is not latex or linuxdoc - MenuMakeDocBook(buffer); - } - // dvi - else if (extyp == "dvi") { - // Run LaTeX as "Update dvi..." Bernhard. - // We want the dvi in the current directory. This - // is achieved by temporarily disabling use of - // temp directory. As a side-effect, we get - // *.log and *.aux files also. (Asger) - bool flag = lyxrc.use_tempdir; - lyxrc.use_tempdir = false; - MenuRunLaTeX(buffer); - lyxrc.use_tempdir = flag; - } - // postscript - else if (extyp == "postscript") { - // Start Print-dialog. Not as good as dvi... Bernhard. - //should start lyxview->getDialogs()->showPrint(); - // to get same as before - // MenuPrint(buffer); - // Since the MenuPrint is a pop-up, we can't use - // the same trick as above. (Asger) - // MISSING: Move of ps-file :-( - // And MenuPrint should not be used for this at all... - } - // ascii - else if (extyp == "ascii") { - MenuMakeAscii(buffer); - } - else if (extyp == "custom") { - MenuSendto(); - } - // HTML - else if (extyp == "html") { - if (buffer->isLinuxDoc()) - MenuMakeHTML_LinuxDoc(buffer); - else if (buffer->isDocBook()) - MenuMakeHTML_DocBook(buffer); - else - MenuMakeHTML(buffer); - } - else { - ShowMessage(buffer, _("Unknown export type: ") + extyp); - } -} -#endif - - void QuitLyX() { lyxerr.debug() << "Running QuitLyX." << endl; @@ -1028,12 +439,12 @@ void AutoSave(BufferView * bv) if (!tmp_ret.empty()) { bv->buffer()->writeFile(tmp_ret, 1); // assume successful write of tmp_ret - if (rename(tmp_ret.c_str(), fname.c_str()) == -1) { + if (lyx::rename(tmp_ret, fname)) { failed = true; // most likely couldn't move between filesystems // unless write of tmp_ret failed // so remove tmp file (if it exists) - remove(tmp_ret.c_str()); + lyx::unlink(tmp_ret); } } else { failed = true; @@ -1140,7 +551,7 @@ void InsertAsciiFile(BufferView * bv, string const & f, bool asParagraph) copy(ii, end, back_inserter(tmpstr)); #endif // insert the string - current_view->hideCursor(); + bv->hideCursor(); // clear the selection bv->beforeChange(); @@ -1172,8 +583,8 @@ void MenuInsertLabel(string const & arg) } -// candidate for move to LyXView -// This is only used in toolbar.C +// This is _only_ used in Toolbar_pimpl.C, move it there and get rid of +// current_view. (Lgb) void LayoutsCB(int sel, void *, Combox *) { string tmp = tostr(sel); @@ -1181,125 +592,6 @@ void LayoutsCB(int sel, void *, Combox *) tmp); } -#ifndef NEW_EXPORT -/* - * SGML Linuxdoc support: - * (flag == 0) make TeX output - * (flag == 1) make dvi output - */ -int RunLinuxDoc(BufferView * bv, int flag, string const & filename) -{ - string s2; - string add_flags; - - int errorcode = 0; - - /* generate a path-less extension name */ - string name = OnlyFilename(ChangeExtension (filename, ".sgml")); - string path = OnlyPath (filename); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { - path = bv->buffer()->tmppath; - } - Path p(path); - - if (!bv->available()) - return 0; - bv->buffer()->makeLinuxDocFile(name, false); - - // CHECK remove this once we have a proper geometry class - - BufferParams::PAPER_SIZE ps = - static_cast(bv->buffer()->params.papersize); - switch (ps) { - case BufferParams::PAPER_A4PAPER: - add_flags = "-p a4"; - break; - case BufferParams::PAPER_USLETTER: - add_flags = "-p letter"; - break; - default: /* nothing to be done yet ;-) */ break; - } - - ProhibitInput(bv); - - Systemcalls one; - switch (flag) { - case 0: /* TeX output asked */ - bv->owner()->getMiniBuffer()->Set(_("Converting LinuxDoc SGML to TeX file...")); - s2 = lyxrc.linuxdoc_to_latex_command + ' ' + add_flags + " -o tex " + ' ' + name; - if (one.startscript(Systemcalls::System, s2)) - errorcode = 1; - break; - case 1: /* dvi output asked */ - bv->owner()->getMiniBuffer()->Set(_("Converting LinuxDoc SGML to dvi file...")); - s2 = lyxrc.linuxdoc_to_latex_command + ' ' + add_flags + " -o dvi " + ' ' + name; - if (one.startscript(Systemcalls::System, s2)) { - errorcode = 1; - } - break; - default: /* unknown output */ - break; - } - - AllowInput(bv); - - bv->buffer()->redraw(); - return errorcode; -} - - -/* - * SGML DocBook support: - * (flag == 1) make dvi output - */ -int RunDocBook(int flag, string const & filename) -{ - /* generate a path-less extension name */ - string name = OnlyFilename(ChangeExtension (filename, ".sgml")); - string path = OnlyPath (filename); - if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) { - path = current_view->buffer()->tmppath; - } - Path p(path); - - if (!current_view->available()) - return 0; - - current_view->buffer()->makeDocBookFile(name, false); - - // Shall this code go or should it stay? (Lgb) - // This code is a placeholder for future implementation. (Jose') -// string add_flags; -// LYX_PAPER_SIZE ps = (LYX_PAPER_SIZE) current_view->buffer()->params.papersize; -// switch (ps) { -// case BufferParams::PAPER_A4PAPER: add_flags = "-p a4"; break; -// case BufferParams::PAPER_USLETTER: add_flags = "-p letter"; break; -// default: /* nothing to be done yet ;-) */ break; -// } - ProhibitInput(current_view); - - int errorcode = 0; - Systemcalls one; - switch (flag) { - case 1: /* dvi output asked */ - { - current_view->owner()->getMiniBuffer()->Set(_("Converting DocBook SGML to dvi file...")); - string s2 = lyxrc.docbook_to_dvi_command + ' ' + name; - if (one.startscript(Systemcalls::System, s2)) { - errorcode = 1; - } - } - break; - default: /* unknown output */ - break; - } - - AllowInput(current_view); - - current_view->buffer()->redraw(); - return errorcode; -} -#endif void MenuLayoutCharacter() { @@ -1320,570 +612,15 @@ void MenuLayoutCharacter() } -static inline -void DeactivateParagraphButtons () +bool UpdateLayoutPreamble() { - fl_deactivate_object (fd_form_paragraph->button_ok); - fl_deactivate_object (fd_form_paragraph->button_apply); - fl_set_object_lcol (fd_form_paragraph->button_ok, FL_INACTIVE); - fl_set_object_lcol (fd_form_paragraph->button_apply, FL_INACTIVE); -} + bool update = true; + if (!current_view->available()) + update = false; - -static inline -void ActivateParagraphButtons () -{ - fl_activate_object (fd_form_paragraph->button_ok); - fl_activate_object (fd_form_paragraph->button_apply); - fl_set_object_lcol (fd_form_paragraph->button_ok, FL_BLACK); - fl_set_object_lcol (fd_form_paragraph->button_apply, FL_BLACK); -} - - -static inline -void DisableParagraphLayout () -{ - DeactivateParagraphButtons(); - fl_deactivate_object (fd_form_paragraph->input_labelwidth); - fl_deactivate_object (fd_form_paragraph->check_lines_top); - fl_deactivate_object (fd_form_paragraph->check_lines_bottom); - fl_deactivate_object (fd_form_paragraph->check_pagebreaks_top); - fl_deactivate_object (fd_form_paragraph->check_pagebreaks_bottom); - fl_deactivate_object (fd_form_paragraph->check_noindent); - fl_deactivate_object (fd_form_paragraph->group_radio_alignment); - fl_deactivate_object (fd_form_paragraph->radio_align_right); - fl_deactivate_object (fd_form_paragraph->radio_align_left); - fl_deactivate_object (fd_form_paragraph->radio_align_block); - fl_deactivate_object (fd_form_paragraph->radio_align_center); - fl_deactivate_object (fd_form_paragraph->input_space_above); - fl_deactivate_object (fd_form_paragraph->input_space_below); - fl_deactivate_object (fd_form_paragraph->choice_space_above); - fl_deactivate_object (fd_form_paragraph->choice_space_below); - fl_deactivate_object (fd_form_paragraph->check_space_above); - fl_deactivate_object (fd_form_paragraph->check_space_below); -} - - -static inline -void EnableParagraphLayout () -{ - ActivateParagraphButtons(); - fl_activate_object (fd_form_paragraph->input_labelwidth); - fl_activate_object (fd_form_paragraph->check_lines_top); - fl_activate_object (fd_form_paragraph->check_lines_bottom); - fl_activate_object (fd_form_paragraph->check_pagebreaks_top); - fl_activate_object (fd_form_paragraph->check_pagebreaks_bottom); - fl_activate_object (fd_form_paragraph->check_noindent); - fl_activate_object (fd_form_paragraph->group_radio_alignment); - fl_activate_object (fd_form_paragraph->radio_align_right); - fl_activate_object (fd_form_paragraph->radio_align_left); - fl_activate_object (fd_form_paragraph->radio_align_block); - fl_activate_object (fd_form_paragraph->radio_align_center); - fl_activate_object (fd_form_paragraph->input_space_above); - fl_activate_object (fd_form_paragraph->input_space_below); - fl_activate_object (fd_form_paragraph->choice_space_above); - fl_activate_object (fd_form_paragraph->choice_space_below); - fl_activate_object (fd_form_paragraph->check_space_above); - fl_activate_object (fd_form_paragraph->check_space_below); -} - - -bool UpdateLayoutParagraph() -{ - if (!current_view->available()) { - if (fd_form_paragraph->form_paragraph->visible) - fl_hide_form(fd_form_paragraph->form_paragraph); - return false; - } - - Buffer * buf = current_view->buffer(); - LyXText * text = 0; - if (current_view->the_locking_inset) - text = current_view->the_locking_inset->getLyXText(current_view); - if (!text) - text = current_view->text; - - fl_set_input(fd_form_paragraph->input_labelwidth, - text->cursor.par()->GetLabelWidthString().c_str()); - fl_set_button(fd_form_paragraph->radio_align_right, 0); - fl_set_button(fd_form_paragraph->radio_align_left, 0); - fl_set_button(fd_form_paragraph->radio_align_center, 0); - fl_set_button(fd_form_paragraph->radio_align_block, 0); - - int align = text->cursor.par()->GetAlign(); - if (align == LYX_ALIGN_LAYOUT) - align = textclasslist.Style(buf->params.textclass, - text->cursor.par()->GetLayout()).align; - - switch (align) { - case LYX_ALIGN_RIGHT: - fl_set_button(fd_form_paragraph->radio_align_right, 1); - break; - case LYX_ALIGN_LEFT: - fl_set_button(fd_form_paragraph->radio_align_left, 1); - break; - case LYX_ALIGN_CENTER: - fl_set_button(fd_form_paragraph->radio_align_center, 1); - break; - default: - fl_set_button(fd_form_paragraph->radio_align_block, 1); - break; - } - -#ifndef NEW_INSETS - fl_set_button(fd_form_paragraph->check_lines_top, - text->cursor.par()->FirstPhysicalPar()->line_top); - - fl_set_button(fd_form_paragraph->check_lines_bottom, - text->cursor.par()->FirstPhysicalPar()->line_bottom); - - fl_set_button(fd_form_paragraph->check_pagebreaks_top, - text->cursor.par()->FirstPhysicalPar()->pagebreak_top); - - fl_set_button(fd_form_paragraph->check_pagebreaks_bottom, - text->cursor.par()->FirstPhysicalPar()->pagebreak_bottom); - fl_set_button(fd_form_paragraph->check_noindent, - text->cursor.par()->FirstPhysicalPar()->noindent); -#else - fl_set_button(fd_form_paragraph->check_lines_top, - text->cursor.par()->line_top); - fl_set_button(fd_form_paragraph->check_lines_bottom, - text->cursor.par()->line_bottom); - fl_set_button(fd_form_paragraph->check_pagebreaks_top, - text->cursor.par()->pagebreak_top); - fl_set_button(fd_form_paragraph->check_pagebreaks_bottom, - text->cursor.par()->pagebreak_bottom); - fl_set_button(fd_form_paragraph->check_noindent, - text->cursor.par()->noindent); -#endif - fl_set_input (fd_form_paragraph->input_space_above, ""); - -#ifndef NEW_INSETS - switch (text->cursor.par()->FirstPhysicalPar()->added_space_top.kind()) { -#else - switch (text->cursor.par()->added_space_top.kind()) { -#endif - - case VSpace::NONE: - fl_set_choice (fd_form_paragraph->choice_space_above, 1); - break; - case VSpace::DEFSKIP: - fl_set_choice (fd_form_paragraph->choice_space_above, 2); - break; - case VSpace::SMALLSKIP: - fl_set_choice (fd_form_paragraph->choice_space_above, 3); - break; - case VSpace::MEDSKIP: - fl_set_choice (fd_form_paragraph->choice_space_above, 4); - break; - case VSpace::BIGSKIP: - fl_set_choice (fd_form_paragraph->choice_space_above, 5); - break; - case VSpace::VFILL: - fl_set_choice (fd_form_paragraph->choice_space_above, 6); - break; - case VSpace::LENGTH: - fl_set_choice (fd_form_paragraph->choice_space_above, 7); -#ifndef NEW_INSETS - fl_set_input (fd_form_paragraph->input_space_above, - text->cursor.par()->FirstPhysicalPar()->added_space_top.length().asString().c_str()); -#else - fl_set_input (fd_form_paragraph->input_space_above, - text->cursor.par()->added_space_top.length().asString().c_str()); -#endif - break; - } -#ifndef NEW_INSETS - fl_set_button (fd_form_paragraph->check_space_above, - text->cursor.par()->FirstPhysicalPar()->added_space_top.keep()); - fl_set_input (fd_form_paragraph->input_space_below, ""); - switch (text->cursor.par()->FirstPhysicalPar()->added_space_bottom.kind()) { -#else - fl_set_button (fd_form_paragraph->check_space_above, - text->cursor.par()->added_space_top.keep()); - fl_set_input (fd_form_paragraph->input_space_below, ""); - switch (text->cursor.par()->added_space_bottom.kind()) { -#endif - case VSpace::NONE: - fl_set_choice (fd_form_paragraph->choice_space_below, - 1); - break; - case VSpace::DEFSKIP: - fl_set_choice (fd_form_paragraph->choice_space_below, - 2); - break; - case VSpace::SMALLSKIP: - fl_set_choice (fd_form_paragraph->choice_space_below, - 3); - break; - case VSpace::MEDSKIP: - fl_set_choice (fd_form_paragraph->choice_space_below, - 4); - break; - case VSpace::BIGSKIP: - fl_set_choice (fd_form_paragraph->choice_space_below, - 5); - break; - case VSpace::VFILL: - fl_set_choice (fd_form_paragraph->choice_space_below, - 6); - break; - case VSpace::LENGTH: - fl_set_choice (fd_form_paragraph->choice_space_below, - 7); -#ifndef NEW_INSETS - fl_set_input (fd_form_paragraph->input_space_below, - text->cursor.par()->FirstPhysicalPar()->added_space_bottom.length().asString().c_str()); - break; - } - fl_set_button (fd_form_paragraph->check_space_below, - text->cursor.par()->FirstPhysicalPar()->added_space_bottom.keep()); - - fl_set_button(fd_form_paragraph->check_noindent, - text->cursor.par()->FirstPhysicalPar()->noindent); -#else - fl_set_input (fd_form_paragraph->input_space_below, - text->cursor.par()->added_space_bottom.length().asString().c_str()); - break; - } - fl_set_button (fd_form_paragraph->check_space_below, - text->cursor.par()->added_space_bottom.keep()); - - fl_set_button(fd_form_paragraph->check_noindent, - text->cursor.par()->noindent); -#endif - if (current_view->buffer()->isReadonly()) { - DisableParagraphLayout(); - } else { - EnableParagraphLayout(); - } - return true; -} - - -void MenuLayoutParagraph() -{ - if (UpdateLayoutParagraph()) { - if (fd_form_paragraph->form_paragraph->visible) { - fl_raise_form(fd_form_paragraph->form_paragraph); - } else { - fl_show_form(fd_form_paragraph->form_paragraph, - FL_PLACE_MOUSE, FL_FULLBORDER, - _("Paragraph Environment")); - } - } -} - -#ifdef USE_OLD_DOCUMENT_LAYOUT -static inline -void DeactivateDocumentButtons () -{ - fl_deactivate_object (fd_form_document->button_ok); - fl_deactivate_object (fd_form_document->button_apply); - fl_set_object_lcol (fd_form_document->button_ok, FL_INACTIVE); - fl_set_object_lcol (fd_form_document->button_apply, FL_INACTIVE); -} - - -static inline -void ActivateDocumentButtons () -{ - fl_activate_object (fd_form_document->button_ok); - fl_activate_object (fd_form_document->button_apply); - fl_set_object_lcol (fd_form_document->button_ok, FL_BLACK); - fl_set_object_lcol (fd_form_document->button_apply, FL_BLACK); -} - - -static inline -void DisableDocumentLayout () -{ - DeactivateDocumentButtons (); - fl_deactivate_object (fd_form_document->group_radio_separation); - fl_deactivate_object (fd_form_document->radio_indent); - fl_deactivate_object (fd_form_document->radio_skip); - fl_deactivate_object (fd_form_document->choice_class); - fl_deactivate_object (fd_form_document->choice_pagestyle); - fl_deactivate_object (fd_form_document->choice_fonts); - fl_deactivate_object (fd_form_document->choice_fontsize); - fl_deactivate_object (fd_form_document->input_float_placement); - fl_deactivate_object (fd_form_document->choice_postscript_driver); - fl_deactivate_object (fd_form_document->choice_inputenc); - fl_deactivate_object (fd_form_document->group_radio_sides); - fl_deactivate_object (fd_form_document->radio_sides_one); - fl_deactivate_object (fd_form_document->radio_sides_two); - fl_deactivate_object (fd_form_document->group_radio_columns); - fl_deactivate_object (fd_form_document->radio_columns_one); - fl_deactivate_object (fd_form_document->radio_columns_two); - fl_deactivate_object (fd_form_document->input_extra); - fl_deactivate_object (fd_form_document->choice_language); - combo_language->deactivate(); - fl_deactivate_object (fd_form_document->input_default_skip); - fl_deactivate_object (fd_form_document->choice_default_skip); - fl_deactivate_object (fd_form_document->slider_secnumdepth); - fl_deactivate_object (fd_form_document->slider_tocdepth); - fl_deactivate_object (fd_form_document->choice_spacing); - fl_deactivate_object (fd_form_document->input_spacing); - fl_deactivate_object (fd_form_document->check_use_amsmath); -} - - -static inline -void EnableDocumentLayout () -{ - ActivateDocumentButtons (); - fl_activate_object (fd_form_document->group_radio_separation); - fl_activate_object (fd_form_document->radio_indent); - fl_activate_object (fd_form_document->radio_skip); - fl_activate_object (fd_form_document->choice_class); - fl_activate_object (fd_form_document->choice_pagestyle); - fl_activate_object (fd_form_document->choice_fonts); - fl_activate_object (fd_form_document->choice_fontsize); - fl_activate_object (fd_form_document->input_float_placement); - fl_activate_object (fd_form_document->choice_postscript_driver); - fl_activate_object (fd_form_document->choice_inputenc); - fl_activate_object (fd_form_document->group_radio_sides); - fl_activate_object (fd_form_document->radio_sides_one); - fl_activate_object (fd_form_document->radio_sides_two); - fl_activate_object (fd_form_document->group_radio_columns); - fl_activate_object (fd_form_document->radio_columns_one); - fl_activate_object (fd_form_document->radio_columns_two); - fl_activate_object (fd_form_document->input_extra); - fl_activate_object (fd_form_document->choice_language); - combo_language->activate(); - fl_activate_object (fd_form_document->input_default_skip); - fl_activate_object (fd_form_document->choice_default_skip); - fl_activate_object (fd_form_document->slider_secnumdepth); - fl_activate_object (fd_form_document->slider_tocdepth); - fl_activate_object (fd_form_document->choice_spacing); - fl_activate_object (fd_form_document->input_spacing); - fl_activate_object (fd_form_document->check_use_amsmath); -} - - -bool UpdateLayoutDocument(BufferParams * params) -{ - if (!current_view->available()) { - if (fd_form_document->form_document->visible) - fl_hide_form(fd_form_document->form_document); - return false; - } - - if (params == 0) - params = ¤t_view->buffer()->params; - LyXTextClass const & tclass = textclasslist.TextClass(params->textclass); - - fl_set_choice_text(fd_form_document->choice_class, - textclasslist.DescOfClass(params->textclass).c_str()); - combo_language->select_text(params->language.c_str()); - - fl_set_choice_text(fd_form_document->choice_fonts, - params->fonts.c_str()); - fl_set_choice_text(fd_form_document->choice_inputenc, - params->inputenc.c_str()); - fl_set_choice_text(fd_form_document->choice_postscript_driver, - params->graphicsDriver.c_str()); - - // ale970405+lasgoutt970513 - fl_clear_choice(fd_form_document->choice_fontsize); - fl_addto_choice(fd_form_document->choice_fontsize, "default"); - fl_addto_choice(fd_form_document->choice_fontsize, - tclass.opt_fontsize().c_str()); - fl_set_choice(fd_form_document->choice_fontsize, - tokenPos(tclass.opt_fontsize(), '|', params->fontsize) + 2); - - // ale970405+lasgoutt970513 - fl_clear_choice(fd_form_document->choice_pagestyle); - fl_addto_choice(fd_form_document->choice_pagestyle, "default"); - fl_addto_choice(fd_form_document->choice_pagestyle, - tclass.opt_pagestyle().c_str()); - - fl_set_choice(fd_form_document->choice_pagestyle, - tokenPos(tclass.opt_pagestyle(), '|', params->pagestyle) + 2); - - fl_set_button(fd_form_document->radio_indent, 0); - fl_set_button(fd_form_document->radio_skip, 0); - - - fl_set_button(fd_form_document->check_use_amsmath, params->use_amsmath); - - if (params->paragraph_separation == BufferParams::PARSEP_INDENT) - fl_set_button(fd_form_document->radio_indent, 1); - else - fl_set_button(fd_form_document->radio_skip, 1); - - switch (params->getDefSkip().kind()) { - case VSpace::SMALLSKIP: - fl_set_choice (fd_form_document->choice_default_skip, 1); - break; - case VSpace::MEDSKIP: - fl_set_choice (fd_form_document->choice_default_skip, 2); - break; - case VSpace::BIGSKIP: - fl_set_choice (fd_form_document->choice_default_skip, 3); - break; - case VSpace::LENGTH: - fl_set_choice (fd_form_document->choice_default_skip, 4); - fl_set_input (fd_form_document->input_default_skip, - params->getDefSkip().asLyXCommand().c_str()); - break; - default: - fl_set_choice (fd_form_document->choice_default_skip, 2); - break; - } - - fl_set_button(fd_form_document->radio_sides_one, 0); - fl_set_button(fd_form_document->radio_sides_two, 0); - - switch (params->sides) { - case LyXTextClass::OneSide: - fl_set_button(fd_form_document->radio_sides_one, 1); - break; - case LyXTextClass::TwoSides: - fl_set_button(fd_form_document->radio_sides_two, 1); - break; - } - - fl_set_button(fd_form_document->radio_columns_one, 0); - fl_set_button(fd_form_document->radio_columns_two, 0); - - if (params->columns == 2) - fl_set_button(fd_form_document->radio_columns_two, 1); - else - fl_set_button(fd_form_document->radio_columns_one, 1); - - fl_set_input(fd_form_document->input_spacing, ""); - switch (params->spacing.getSpace()) { - case Spacing::Default: // nothing bad should happen with this - case Spacing::Single: - { - // \singlespacing - fl_set_choice(fd_form_document->choice_spacing, 1); - break; - } - case Spacing::Onehalf: - { - // \onehalfspacing - fl_set_choice(fd_form_document->choice_spacing, 2); - break; - } - case Spacing::Double: - { - // \ doublespacing - fl_set_choice(fd_form_document->choice_spacing, 3); - break; - } - case Spacing::Other: - { - fl_set_choice(fd_form_document->choice_spacing, 4); - std::ostringstream sval; - sval << params->spacing.getValue(); // setw? - fl_set_input(fd_form_document->input_spacing, - sval.str().c_str()); - break; - } - } - - - fl_set_counter_value(fd_form_document->slider_secnumdepth, - params->secnumdepth); - fl_set_counter_value(fd_form_document->slider_tocdepth, - params->tocdepth); - if (!params->float_placement.empty()) { // buffer local (Lgb) - fl_set_input(fd_form_document->input_float_placement, - params->float_placement.c_str()); - } else { - fl_set_input(fd_form_document->input_float_placement, ""); - } - if (!params->options.empty()) - fl_set_input(fd_form_document->input_extra, - params->options.c_str()); - else - fl_set_input(fd_form_document->input_extra, ""); - - if (current_view->buffer()->isSGML()) { - // bullets not used in SGML derived documents - fl_deactivate_object(fd_form_document->button_bullets); - fl_set_object_lcol(fd_form_document->button_bullets, - FL_INACTIVE); - } else { - fl_activate_object(fd_form_document->button_bullets); - fl_set_object_lcol(fd_form_document->button_bullets, - FL_BLACK); - } - - if (current_view->buffer()->isReadonly()) { - DisableDocumentLayout(); - } else { - EnableDocumentLayout(); - } - - return true; -} - - -void MenuLayoutDocument() -{ - if (UpdateLayoutDocument()) { - if (fd_form_document->form_document->visible) { - fl_raise_form(fd_form_document->form_document); - } else { - fl_show_form(fd_form_document->form_document, - FL_PLACE_MOUSE, FL_FULLBORDER, - _("Document Layout")); - } - } -} - - -bool UpdateLayoutQuotes() -{ - bool update = true; - if (!current_view->available() - || current_view->buffer()->isReadonly()) - update = false; - - if (update) { - fl_set_choice(fd_form_quotes->choice_quotes_language, - current_view->buffer()->params.quotes_language + 1); - fl_set_button(fd_form_quotes->radio_single, 0); - fl_set_button(fd_form_quotes->radio_double, 0); - - if (current_view->buffer()->params.quotes_times == InsetQuotes::SingleQ) - fl_set_button(fd_form_quotes->radio_single, 1); - else - fl_set_button(fd_form_quotes->radio_double, 1); - } else if (fd_form_quotes->form_quotes->visible) { - fl_hide_form(fd_form_quotes->form_quotes); - } - return update; -} - - -void MenuLayoutQuotes() -{ - if (UpdateLayoutQuotes()) { - if (fd_form_quotes->form_quotes->visible) { - fl_raise_form(fd_form_quotes->form_quotes); - } else { - fl_show_form(fd_form_quotes->form_quotes, - FL_PLACE_MOUSE, FL_FULLBORDER, - _("Quotes")); - } - } -} -#endif - - -bool UpdateLayoutPreamble() -{ - bool update = true; - if (!current_view->available()) - update = false; - - if (update) { - fl_set_input(fd_form_preamble->input_preamble, - current_view->buffer()->params.preamble.c_str()); + if (update) { + fl_set_input(fd_form_preamble->input_preamble, + current_view->buffer()->params.preamble.c_str()); if (current_view->buffer()->isReadonly()) { fl_deactivate_object(fd_form_preamble->input_preamble); @@ -2051,152 +788,6 @@ extern "C" void TimerCB(FL_OBJECT *, long) } -/* callbacks for form form_paragraph */ - -extern "C" void ParagraphVSpaceCB(FL_OBJECT * obj, long ) -{ - // "Synchronize" the choices and input fields, making it - // impossible to commit senseless data. - - FD_form_paragraph const * fp = fd_form_paragraph; - - if (obj == fp->choice_space_above) { - if (fl_get_choice (fp->choice_space_above) != 7) { - fl_set_input (fp->input_space_above, ""); - ActivateParagraphButtons(); - } - } else if (obj == fp->choice_space_below) { - if (fl_get_choice (fp->choice_space_below) != 7) { - fl_set_input (fp->input_space_below, ""); - ActivateParagraphButtons(); - } - } else if (obj == fp->input_space_above) { - string input = fl_get_input (fp->input_space_above); - - if (input.empty()) { - fl_set_choice (fp->choice_space_above, 1); - ActivateParagraphButtons(); - } - else if (isValidGlueLength (input)) { - fl_set_choice (fp->choice_space_above, 7); - ActivateParagraphButtons(); - } - else { - fl_set_choice (fp->choice_space_above, 7); - DeactivateParagraphButtons(); - } - } else if (obj == fp->input_space_below) { - string input = fl_get_input (fp->input_space_below); - - if (input.empty()) { - fl_set_choice (fp->choice_space_below, 1); - ActivateParagraphButtons(); - } - else if (isValidGlueLength (input)) { - fl_set_choice (fp->choice_space_below, 7); - ActivateParagraphButtons(); - } - else { - fl_set_choice (fp->choice_space_below, 7); - DeactivateParagraphButtons(); - } - } -} - - -extern "C" void ParagraphApplyCB(FL_OBJECT *, long) -{ - if (!current_view->available()) - return; - - VSpace space_top, space_bottom; - LyXAlignment align; - string labelwidthstring; - bool noindent; - - // If a vspace kind is "Length" but there's no text in - // the input field, reset the kind to "None". - if (fl_get_choice (fd_form_paragraph->choice_space_above) == 7 - && !*(fl_get_input (fd_form_paragraph->input_space_above))) { - fl_set_choice (fd_form_paragraph->choice_space_above, 1); - } - if (fl_get_choice (fd_form_paragraph->choice_space_below) == 7 - && !*(fl_get_input (fd_form_paragraph->input_space_below))) { - fl_set_choice (fd_form_paragraph->choice_space_below, 1); - } - - bool line_top = fl_get_button(fd_form_paragraph->check_lines_top); - bool line_bottom = fl_get_button(fd_form_paragraph->check_lines_bottom); - bool pagebreak_top = fl_get_button(fd_form_paragraph->check_pagebreaks_top); - bool pagebreak_bottom = fl_get_button(fd_form_paragraph->check_pagebreaks_bottom); - switch (fl_get_choice (fd_form_paragraph->choice_space_above)) { - case 1: space_top = VSpace(VSpace::NONE); break; - case 2: space_top = VSpace(VSpace::DEFSKIP); break; - case 3: space_top = VSpace(VSpace::SMALLSKIP); break; - case 4: space_top = VSpace(VSpace::MEDSKIP); break; - case 5: space_top = VSpace(VSpace::BIGSKIP); break; - case 6: space_top = VSpace(VSpace::VFILL); break; - case 7: space_top = VSpace(LyXGlueLength (fl_get_input (fd_form_paragraph->input_space_above))); break; - } - if (fl_get_button (fd_form_paragraph->check_space_above)) - space_top.setKeep (true); - switch (fl_get_choice (fd_form_paragraph->choice_space_below)) { - case 1: space_bottom = VSpace(VSpace::NONE); break; - case 2: space_bottom = VSpace(VSpace::DEFSKIP); break; - case 3: space_bottom = VSpace(VSpace::SMALLSKIP); break; - case 4: space_bottom = VSpace(VSpace::MEDSKIP); break; - case 5: space_bottom = VSpace(VSpace::BIGSKIP); break; - case 6: space_bottom = VSpace(VSpace::VFILL); break; - case 7: space_bottom = VSpace(LyXGlueLength (fl_get_input (fd_form_paragraph->input_space_below))); break; - } - if (fl_get_button (fd_form_paragraph->check_space_below)) - space_bottom.setKeep (true); - - if (fl_get_button(fd_form_paragraph->radio_align_left)) - align = LYX_ALIGN_LEFT; - else if (fl_get_button(fd_form_paragraph->radio_align_right)) - align = LYX_ALIGN_RIGHT; - else if (fl_get_button(fd_form_paragraph->radio_align_center)) - align = LYX_ALIGN_CENTER; - else - align = LYX_ALIGN_BLOCK; - - labelwidthstring = fl_get_input(fd_form_paragraph->input_labelwidth); - noindent = fl_get_button(fd_form_paragraph->check_noindent); - - LyXText * text = 0; - if (current_view->the_locking_inset) - text = current_view->the_locking_inset->getLyXText(current_view); - if (!text) - text = current_view->text; - text->SetParagraph(current_view, - line_top, - line_bottom, - pagebreak_top, - pagebreak_bottom, - space_top, - space_bottom, - align, - labelwidthstring, - noindent); - current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); - current_view->owner()->getMiniBuffer()->Set(_("Paragraph layout set")); -} - - -extern "C" void ParagraphCancelCB(FL_OBJECT *, long) -{ - fl_hide_form(fd_form_paragraph->form_paragraph); -} - - -extern "C" void ParagraphOKCB(FL_OBJECT *ob, long data) -{ - ParagraphApplyCB(ob, data); - ParagraphCancelCB(ob, data); -} - - /* callbacks for form form_character */ extern "C" void CharacterApplyCB(FL_OBJECT *, long) @@ -2223,374 +814,6 @@ extern "C" void CharacterOKCB(FL_OBJECT *ob, long data) } -#ifdef USE_OLD_DOCUMENT_LAYOUT -/* callbacks for form form_document */ -void UpdateDocumentButtons(BufferParams const & params) -{ - fl_set_choice(fd_form_document->choice_pagestyle, 1); - - switch (params.sides) { - case LyXTextClass::OneSide: - fl_set_button(fd_form_document->radio_sides_one, 1); - break; - case LyXTextClass::TwoSides: - fl_set_button(fd_form_document->radio_sides_two, 1); - break; - } - - if (params.columns == 2) - fl_set_button(fd_form_document->radio_columns_two, 1); - else - fl_set_button(fd_form_document->radio_columns_one, 1); - - fl_set_input(fd_form_document->input_extra, params.options.c_str()); - fl_set_counter_value(fd_form_document->slider_secnumdepth, - params.secnumdepth); - fl_set_counter_value(fd_form_document->slider_tocdepth, - params.tocdepth); - -} - -extern "C" void ChoiceClassCB(FL_OBJECT * ob, long) -{ - ProhibitInput(current_view); - if (textclasslist.Load(fl_get_choice(ob)-1)) { - if (AskQuestion(_("Should I set some parameters to"), - fl_get_choice_text(ob), - _("the defaults of this document class?"))) { - BufferParams params = BufferParams(); - params.textclass = fl_get_choice(ob)-1; - params.useClassDefaults(); - UpdateLayoutDocument(¶ms); - UpdateDocumentButtons(params); - } - } else { - // unable to load new style - WriteAlert(_("Conversion Errors!"), - _("Unable to switch to new document class."), - _("Reverting to original document class.")); - fl_set_choice(fd_form_document->choice_class, - current_view->buffer()->params.textclass + 1); - } - AllowInput(current_view); -} - - -extern "C" void DocumentDefskipCB(FL_OBJECT * obj, long) -{ - // "Synchronize" the choice and the input field, so that it - // is impossible to commit senseless data. - FD_form_document const * fd = fd_form_document; - - if (obj == fd->choice_default_skip) { - if (fl_get_choice (fd->choice_default_skip) != 4) { - fl_set_input (fd->input_default_skip, ""); - ActivateDocumentButtons(); - } - } else if (obj == fd->input_default_skip) { - - char const * input = fl_get_input (fd->input_default_skip); - - if (!*input) { - fl_set_choice (fd->choice_default_skip, 2); - ActivateDocumentButtons(); - } else if (isValidGlueLength (input)) { - fl_set_choice (fd->choice_default_skip, 4); - ActivateDocumentButtons(); - } else { - fl_set_choice (fd->choice_default_skip, 4); - DeactivateDocumentButtons(); - } - } -} - - -extern "C" void DocumentSpacingCB(FL_OBJECT * obj, long) -{ - // "Synchronize" the choice and the input field, so that it - // is impossible to commit senseless data. - FD_form_document const * fd = fd_form_document; - - if (obj == fd->choice_spacing - && fl_get_choice (fd->choice_spacing) != 4) { - fl_set_input(fd->input_spacing, ""); - } else if (obj == fd->input_spacing) { - - const char* input = fl_get_input (fd->input_spacing); - - if (!*input) { - fl_set_choice (fd->choice_spacing, 1); - } else { - fl_set_choice (fd->choice_spacing, 4); - } - } -} - - -extern "C" void DocumentApplyCB(FL_OBJECT *, long) -{ - bool redo = false; - BufferParams * params = &(current_view->buffer()->params); - - Language const * old_language = params->language_info; - params->language = combo_language->getline(); - Languages::iterator lit = languages.find(params->language); - - Language const * new_language; - if (lit != languages.end()) - new_language = &(*lit).second; - else - new_language = default_language; - - if (current_view->available()) { - if (old_language != new_language - && old_language->RightToLeft() == new_language->RightToLeft() - && !current_view->buffer()->isMultiLingual()) - current_view->buffer()->ChangeLanguage(old_language, - new_language); - if (old_language != new_language) { - //current_view->buffer()->redraw(); - redo = true; - } - } - params->language_info = new_language; - - // If default skip is a "Length" but there's no text in the - // input field, reset the kind to "Medskip", which is the default. - if (fl_get_choice (fd_form_document->choice_default_skip) == 4 - && !*(fl_get_input (fd_form_document->input_default_skip))) { - fl_set_choice (fd_form_document->choice_default_skip, 2); - } - - /* this shouldn't be done automatically IMO. For example I write german - * documents with an american keyboard very often. Matthias */ - - /* ChangeKeymap(buffer->parameters.language, TRUE, false, - fl_get_choice(fd_form_document->choice_language)); */ - params->fonts = - fl_get_choice_text(fd_form_document->choice_fonts); - params->inputenc = - fl_get_choice_text(fd_form_document->choice_inputenc); - params->fontsize = - fl_get_choice_text(fd_form_document->choice_fontsize); - params->pagestyle = - fl_get_choice_text(fd_form_document->choice_pagestyle); - params->graphicsDriver = - fl_get_choice_text(fd_form_document->choice_postscript_driver); - params->use_amsmath = - fl_get_button(fd_form_document->check_use_amsmath); - - if (!current_view->available()) - return; - - current_view->text->SetCursor(current_view, - current_view->text->cursor.par(), - current_view->text->cursor.pos()); - current_view->setState(); - - LyXTextClassList::ClassList::size_type new_class = - fl_get_choice(fd_form_document->choice_class) - 1; - - if (params->textclass != new_class) { - // try to load new_class - if (textclasslist.Load(new_class)) { - // successfully loaded - redo = true; - current_view->owner()->getMiniBuffer()-> - Set(_("Converting document to new document class...")); - CutAndPaste cap; - int ret = cap.SwitchLayoutsBetweenClasses( - current_view->buffer()->params.textclass, - new_class, - current_view->buffer()->paragraph); - - if (ret) { - string s; - if (ret == 1) - s = _("One paragraph couldn't be converted"); - else { - s += tostr(ret); - s += _(" paragraphs couldn't be converted"); - } - WriteAlert(_("Conversion Errors!"), s, - _("into chosen document class")); - } - - params->textclass = new_class; - } else { - // problem changing class -- warn user and retain old style - WriteAlert(_("Conversion Errors!"), - _("Unable to switch to new document class."), - _("Reverting to original document class.")); - fl_set_choice(fd_form_document->choice_class, params->textclass + 1); - } - } - - char tmpsep = params->paragraph_separation; - if (fl_get_button(fd_form_document->radio_indent)) - params->paragraph_separation = BufferParams::PARSEP_INDENT; - else - params->paragraph_separation = BufferParams::PARSEP_SKIP; - if (tmpsep != params->paragraph_separation) - redo = true; - - VSpace tmpdefskip = params->getDefSkip(); - switch (fl_get_choice (fd_form_document->choice_default_skip)) { - case 1: params->setDefSkip(VSpace(VSpace::SMALLSKIP)); break; - case 2: params->setDefSkip(VSpace(VSpace::MEDSKIP)); break; - case 3: params->setDefSkip(VSpace(VSpace::BIGSKIP)); break; - case 4: params->setDefSkip( - VSpace (LyXGlueLength (fl_get_input - (fd_form_document->input_default_skip)))); - break; - // DocumentDefskipCB assures that this never happens - default: params->setDefSkip(VSpace(VSpace::MEDSKIP)); break; - } - if (!(tmpdefskip == params->getDefSkip())) - redo = true; - - if (fl_get_button(fd_form_document->radio_columns_two)) - params->columns = 2; - else - params->columns = 1; - if (fl_get_button(fd_form_document->radio_sides_two)) - params->sides = LyXTextClass::TwoSides; - else - params->sides = LyXTextClass::OneSide; - - Spacing tmpSpacing = params->spacing; - switch(fl_get_choice(fd_form_document->choice_spacing)) { - case 1: - lyxerr.debug() << "Spacing: SINGLE" << endl; - params->spacing.set(Spacing::Single); - break; - case 2: - lyxerr.debug() << "Spacing: ONEHALF" << endl; - params->spacing.set(Spacing::Onehalf); - break; - case 3: - lyxerr.debug() << "Spacing: DOUBLE" << endl; - params->spacing.set(Spacing::Double); - break; - case 4: - lyxerr.debug() << "Spacing: OTHER" << endl; - params->spacing.set(Spacing::Other, - fl_get_input(fd_form_document->input_spacing)); - break; - } - if (tmpSpacing != params->spacing) - redo = true; - - signed char tmpchar = - static_cast(fl_get_counter_value(fd_form_document->slider_secnumdepth)); - if (params->secnumdepth != tmpchar) - redo = true; - params->secnumdepth = tmpchar; - - params->tocdepth = - static_cast(fl_get_counter_value(fd_form_document->slider_tocdepth)); - - params->float_placement = - fl_get_input(fd_form_document->input_float_placement); - - // More checking should be done to ensure the string doesn't have - // spaces or illegal placement characters in it. (thornley) - - if (redo) - current_view->redoCurrentBuffer(); - - current_view->owner()->getMiniBuffer()->Set(_("Document layout set")); - current_view->buffer()->markDirty(); - - params->options = - fl_get_input(fd_form_document->input_extra); -} - - -extern "C" void DocumentCancelCB(FL_OBJECT *, long) -{ - fl_hide_form(fd_form_document->form_document); -} - - -extern "C" void DocumentOKCB(FL_OBJECT * ob, long data) -{ - DocumentCancelCB(ob, data); - DocumentApplyCB(ob, data); -} - - -extern "C" void DocumentBulletsCB(FL_OBJECT *, long) -{ - bulletForm(); - // bullet callbacks etc. in bullet_panel.C -- ARRae -} - -/* callbacks for form form_quotes */ - -extern "C" void QuotesApplyCB(FL_OBJECT *, long) -{ - if (!current_view->available()) - return; - - current_view->owner()->getMiniBuffer()->Set(_("Quotes type set")); - InsetQuotes::quote_language lga = InsetQuotes::EnglishQ; - switch(fl_get_choice(fd_form_quotes->choice_quotes_language) - 1) { - case 0: - lga = InsetQuotes::EnglishQ; - break; - case 1: - lga = InsetQuotes::SwedishQ; - break; - case 2: - lga = InsetQuotes::GermanQ; - break; - case 3: - lga = InsetQuotes::PolishQ; - break; - case 4: - lga = InsetQuotes::FrenchQ; - break; - case 5: - lga = InsetQuotes::DanishQ; - break; - } - current_view->buffer()->params.quotes_language = lga; - if (fl_get_button(fd_form_quotes->radio_single)) - current_view->buffer()-> - params.quotes_times = InsetQuotes::SingleQ; - else - current_view->buffer()-> - params.quotes_times = InsetQuotes::DoubleQ; -} - - -extern "C" void QuotesCancelCB(FL_OBJECT *, long) -{ - fl_hide_form(fd_form_quotes->form_quotes); -} - - -extern "C" void QuotesOKCB(FL_OBJECT * ob, long data) -{ - QuotesApplyCB(ob, data); - QuotesCancelCB(ob, data); -} -#else -// this is needed for now! -extern "C" void ChoiceClassCB(FL_OBJECT *, long) {} -extern "C" void DocumentDefskipCB(FL_OBJECT *, long) {} -extern "C" void DocumentSpacingCB(FL_OBJECT *, long) {} -extern "C" void DocumentApplyCB(FL_OBJECT *, long) {} -extern "C" void DocumentCancelCB(FL_OBJECT *, long) {} -extern "C" void DocumentOKCB(FL_OBJECT *, long) {} -extern "C" void DocumentBulletsCB(FL_OBJECT *, long) {} -extern "C" void QuotesApplyCB(FL_OBJECT *, long) {} -extern "C" void QuotesCancelCB(FL_OBJECT *, long) {} -extern "C" void QuotesOKCB(FL_OBJECT *, long) {} -#endif - - /* callbacks for form form_preamble */ extern "C" void PreambleCancelCB(FL_OBJECT *, long) @@ -2618,101 +841,6 @@ extern "C" void PreambleOKCB(FL_OBJECT * ob, long data) } -/* callbacks for form form_table */ - -extern "C" -void TableApplyCB(FL_OBJECT *, long) -{ - if (!current_view->available()) - return; - - current_view->owner()->getMiniBuffer()->Set(_("Inserting table...")); - - int const ysize = int(fl_get_slider_value(fd_form_table->slider_columns) + 0.5); - int const xsize = int(fl_get_slider_value(fd_form_table->slider_rows) + 0.5); - - - current_view->hideCursor(); - current_view->beforeChange(); - current_view->update(BufferView::SELECT|BufferView::FITCUR); - - current_view->text->SetCursorParUndo(current_view->buffer()); - current_view->text->FreezeUndo(); - - current_view->text->BreakParagraph(current_view); - current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); - - if (current_view->text->cursor.par()->Last()) { - current_view->text->CursorLeft(current_view); - - current_view->text->BreakParagraph(current_view); - current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); - } - - current_view->text->current_font.setLatex(LyXFont::OFF); - //if (!fl_get_button(fd_form_table->check_latex)){ - // insert the new wysiwy table - current_view->text->SetLayout(current_view, 0); // standard layout -#ifndef NEW_INSETS - if (current_view->text->cursor.par()->footnoteflag == - LyXParagraph::NO_FOOTNOTE) { -#endif - current_view->text - ->SetParagraph(current_view, 0, 0, - 0, 0, - VSpace (0.3 * current_view->buffer()-> - params.spacing.getValue(), - LyXLength::CM), - VSpace (0.3 * current_view->buffer()-> - params.spacing.getValue(), - LyXLength::CM), - LYX_ALIGN_CENTER, - string(), - 0); -#ifndef NEW_INSETS - } else { - current_view->text - ->SetParagraph(current_view, 0, 0, - 0, 0, - VSpace(VSpace::NONE), - VSpace(VSpace::NONE), - LYX_ALIGN_CENTER, - string(), - 0); - } -#endif - Language const * lang = - current_view->text->cursor.par()->getParLanguage(current_view->buffer()->params); - LyXFont font(LyXFont::ALL_INHERIT, lang); - for (int i = 0; i < xsize * ysize - 1; ++i) { - current_view->text->cursor.par() - ->InsertChar(0, LyXParagraph::META_NEWLINE, font); - } - current_view->text->RedoParagraph(current_view); - - current_view->text->UnFreezeUndo(); - - current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); - current_view->owner()->getMiniBuffer()->Set(_("Table inserted")); - current_view->setState(); -} - - -extern "C" -void TableCancelCB(FL_OBJECT *, long) -{ - fl_hide_form(fd_form_table->form_table); -} - - -extern "C" -void TableOKCB(FL_OBJECT * ob, long data) -{ - TableApplyCB(ob, data); - TableCancelCB(ob, data); -} - - void Figure() { if (fd_form_figure->form_figure->visible) { @@ -2725,18 +853,6 @@ void Figure() } -void Table() -{ - if (fd_form_table->form_table->visible) { - fl_raise_form(fd_form_table->form_table); - } else { - fl_show_form(fd_form_table->form_table, - FL_PLACE_MOUSE, FL_FULLBORDER, - _("Insert Table")); - } -} - - /* callbacks for form form_figure */ extern "C" void FigureApplyCB(FL_OBJECT *, long) diff --git a/src/lyx_cb.h b/src/lyx_cb.h index ce23fb9dbc..8904ee965f 100644 --- a/src/lyx_cb.h +++ b/src/lyx_cb.h @@ -3,6 +3,7 @@ #define LYX_CB_H #include "LString.h" +#include "lyxfont.h" class BufferParams; diff --git a/src/lyx_gui.C b/src/lyx_gui.C index bc088c945e..8c53ad0b89 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -44,16 +44,8 @@ using std::endl; FD_form_title * fd_form_title; -FD_form_paragraph * fd_form_paragraph; -FD_form_paragraph_extra * fd_form_paragraph_extra; FD_form_character * fd_form_character; -FD_form_document * fd_form_document; -FD_form_paper * fd_form_paper; -FD_form_table_options * fd_form_table_options; -FD_form_table_extra * fd_form_table_extra; -FD_form_quotes * fd_form_quotes; FD_form_preamble * fd_form_preamble; -FD_form_table * fd_form_table; FD_form_sendto * fd_form_sendto; FD_form_figure * fd_form_figure; FD_LaTeXLog * fd_latex_log; // from log_form.h @@ -301,31 +293,6 @@ void LyXGUI::create_forms() fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_end_form(); } - - // the paragraph form - fd_form_paragraph = create_form_form_paragraph(); - fl_set_form_atclose(fd_form_paragraph->form_paragraph, - CancelCloseBoxCB, 0); - fl_addto_choice(fd_form_paragraph->choice_space_above, - _(" None | Defskip | Smallskip " - "| Medskip | Bigskip | VFill | Length ")); - fl_addto_choice(fd_form_paragraph->choice_space_below, - _(" None | Defskip | Smallskip " - "| Medskip | Bigskip | VFill | Length ")); - fl_set_input_return(fd_form_paragraph->input_space_above, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paragraph->input_space_below, - FL_RETURN_ALWAYS); - - // the paragraph extra form - fd_form_paragraph_extra = create_form_form_paragraph_extra(); - fl_set_form_atclose(fd_form_paragraph_extra->form_paragraph_extra, - CancelCloseBoxCB, 0); - fl_set_input_return(fd_form_paragraph_extra->input_pextra_width, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paragraph_extra->input_pextra_widthp, - FL_RETURN_ALWAYS); - lyxerr[Debug::INIT] << "Initializing form_paragraph...done" << endl; // the character form fd_form_character = create_form_form_character(); @@ -362,112 +329,13 @@ void LyXGUI::create_forms() // build up the combox entries combo_language2->addto(_("No change")); combo_language2->addto(_("Reset")); - for(Languages::const_iterator cit = languages.begin(); + for(Languages::iterator cit = languages.begin(); cit != languages.end(); ++cit) { if ((*cit).second.lang() != "default") combo_language2->addto((*cit).second.lang().c_str()); } combo_language2->select_text(_("No change")); -#ifdef USE_OLD_DOCUMENT_LAYOUT - // the document form - fd_form_document = create_form_form_document(); - fl_set_form_atclose(fd_form_document->form_document, - CancelCloseBoxCB, 0); - fl_addto_choice(fd_form_document->choice_spacing, - _(" Single | OneHalf | Double | Other ")); - - fl_set_counter_bounds(fd_form_document->slider_secnumdepth,-2, 5); - fl_set_counter_bounds(fd_form_document->slider_tocdepth,-1, 5); - fl_set_counter_step(fd_form_document->slider_secnumdepth, 1, 1); - fl_set_counter_step(fd_form_document->slider_tocdepth, 1, 1); - fl_set_counter_precision(fd_form_document->slider_secnumdepth, 0); - fl_set_counter_precision(fd_form_document->slider_tocdepth, 0); - fl_addto_form(fd_form_document->form_document); - combo_language = new Combox(FL_COMBOX_DROPLIST); - ob = fd_form_document->choice_language; - combo_language->add(ob->x, ob->y, ob->w, ob->h, 250); - combo_language->shortcut("#G", 1); - fl_end_form(); - - // "default" is not part of the languages array any more. - combo_language->addto("default"); - for(Languages::const_iterator cit = languages.begin(); - cit != languages.end(); ++cit) { - combo_language->addto((*cit).second.lang().c_str()); - } - - // not really necessary, but we can do it anyway. - fl_addto_choice(fd_form_document->choice_fontsize, "default|10|11|12"); - int n; - for (n = 0; tex_fonts[n][0]; ++n) { - fl_addto_choice(fd_form_document->choice_fonts, tex_fonts[n]); - } - - fl_addto_choice(fd_form_document->choice_inputenc, - "default|auto|latin1|latin2|latin5" - "|koi8-r|koi8-u|cp866|cp1251|iso88595"); - - for (n = 0; tex_graphics[n][0]; ++n) { - fl_addto_choice(fd_form_document->choice_postscript_driver, - tex_graphics[n]); - } - // not really necessary, but we can do it anyway. - fl_addto_choice(fd_form_document->choice_pagestyle, - "default|empty|plain|headings|fancy"); - fl_addto_choice(fd_form_document->choice_default_skip, - _(" Smallskip | Medskip | Bigskip | Length ")); - fl_set_input_return(fd_form_document->input_default_skip, - FL_RETURN_ALWAYS); - fl_set_form_minsize(fd_form_document->form_document, - fd_form_document->form_document->w, - fd_form_document->form_document->h); - lyxerr[Debug::INIT] << "Initializing form_document...done" << endl; - - // the paper form - fd_form_paper = create_form_form_paper(); - fl_set_form_atclose(fd_form_paper->form_paper, - CancelCloseBoxCB, 0); - fl_addto_choice(fd_form_paper->choice_papersize2, - _(" Default | Custom | USletter | USlegal " - "| USexecutive | A3 | A4 | A5 | B3 | B4 | B5 ")); - fl_addto_choice(fd_form_paper->choice_paperpackage, - _(" None " - "| A4 small Margins (only portrait) " - "| A4 very small Margins (only portrait) " - "| A4 very wide margins (only portrait) ")); - fl_set_input_return(fd_form_paper->input_custom_width, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paper->input_custom_height, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paper->input_top_margin, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paper->input_bottom_margin, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paper->input_left_margin, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paper->input_right_margin, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paper->input_head_height, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paper->input_head_sep, - FL_RETURN_ALWAYS); - fl_set_input_return(fd_form_paper->input_foot_skip, - FL_RETURN_ALWAYS); - lyxerr[Debug::INIT] << "Initializing form_paper...done" << endl; -#endif - -#ifdef USE_OLD_DOCUMENT_LAYOUT - // the quotes form - fd_form_quotes = create_form_form_quotes(); - fl_set_form_atclose(fd_form_quotes->form_quotes, - CancelCloseBoxCB, 0); - // Is it wrong of me to use « » instead of << >> ? (Lgb) - // Maybe if people use a font other than latin1... (JMarc) - fl_addto_choice(fd_form_quotes->choice_quotes_language, - _(" ``text'' | ''text'' | ,,text`` | ,,text'' | «text» | »text« ")); -#endif - // the preamble form fd_form_preamble = create_form_form_preamble(); fl_set_form_atclose(fd_form_preamble->form_preamble, diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index 612276c4c7..91ea7db44d 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -20,7 +20,6 @@ #include "BufferView.h" #include "bibforms.h" #include "buffer.h" -#include "bullet_forms.h" #include "form1.h" #include "gettext.h" #include "include_form.h" @@ -42,21 +41,12 @@ using std::make_pair; extern BufferView * current_view; -extern FD_form_paragraph * fd_form_paragraph; -extern FD_form_paragraph_extra * fd_form_paragraph_extra; extern FD_form_character * fd_form_character; -extern FD_form_document * fd_form_document; -extern FD_form_paper * fd_form_paper; -extern FD_form_table_options * fd_form_table_options; -extern FD_form_quotes * fd_form_quotes; extern FD_form_preamble * fd_form_preamble; -extern FD_form_table * fd_form_table; extern FD_form_sendto * fd_form_sendto; extern FD_form_figure * fd_form_figure; -extern FD_form_paragraph_extra * fd_form_paragraph_extra; extern FD_LaTeXLog * fd_latex_log; extern FD_form_spell_check * fd_form_spell_check; -extern FD_form_bullet * fd_form_bullet; extern FD_panel * fd_panel; extern FD_delim * fd_delim; extern FD_deco * fd_deco; @@ -91,31 +81,9 @@ void CloseAllBufferRelatedDialogs() // have been created otherwise hiding one could cause a crash // need the visible check otherwise XForms prints a warning // if hiding an invisible form - if (fd_form_paragraph->form_paragraph->visible) { - fl_hide_form(fd_form_paragraph->form_paragraph); - } - if (fd_form_paragraph_extra->form_paragraph_extra->visible) { - fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra); - } if (fd_form_character->form_character->visible) { fl_hide_form(fd_form_character->form_character); } -#ifdef USE_OLD_DOCUMENT_LAYOUT - if (fd_form_document->form_document->visible) { - fl_hide_form(fd_form_document->form_document); - } - if (fd_form_quotes->form_quotes->visible) { - fl_hide_form(fd_form_quotes->form_quotes); - } - if (fd_form_paper->form_paper->visible) { - fl_hide_form(fd_form_paper->form_paper); - } - if (fd_form_bullet) { - if (fd_form_bullet->form_bullet->visible) { - fl_hide_form(fd_form_bullet->form_bullet); - } - } -#endif if (fd_form_preamble->form_preamble->visible) { fl_hide_form(fd_form_preamble->form_preamble); } @@ -175,31 +143,9 @@ void CloseAllBufferRelatedDialogs() // Again the Signal/Slot mechanism is tailor made for this task. void updateAllVisibleBufferRelatedDialogs() { -#ifdef USE_OLD_DOCUMENT_LAYOUT - if (fd_form_document->form_document->visible) { - UpdateLayoutDocument(); - } - if (fd_form_quotes->form_quotes->visible) { - UpdateLayoutQuotes(); - } - if (fd_form_paper->form_paper->visible) { - UpdateLayoutPaper(); - } -#endif if (fd_form_preamble->form_preamble->visible) { UpdateLayoutPreamble(); } - if (fd_form_paragraph->form_paragraph->visible) { - UpdateLayoutParagraph(); - } - if (fd_form_paragraph_extra->form_paragraph_extra->visible) { - UpdateParagraphExtra(); - } - if (fd_form_bullet) { - if (fd_form_bullet->form_bullet->visible) { - updateBulletForm(); - } - } if (fd_latex_log->LaTeXLog->visible) { LatexLogUpdate(0,0); } @@ -341,7 +287,7 @@ void WriteAlert(string const & s1, string const & s2, string const & s3) // Alarms user of something related to files void WriteFSAlert(string const & s1, string const & s2) { - WriteAlert (s1, s2, strerror(errno)); + WriteAlert(s1, s2, strerror(errno)); } diff --git a/src/lyx_main.C b/src/lyx_main.C index 6051cc406c..0eabab2021 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -38,10 +38,6 @@ #include "MenuBackend.h" #include "ToolbarDefaults.h" #include "lyxlex.h" -#if 1 -// only to get access to NEW_EXPORT -#include "exporter.h" -#endif using std::endl; @@ -141,7 +137,8 @@ LyX::LyX(int * argc, char * argv[]) // Execute batch commands if available if (!batch_command.empty()) { - lyxerr << "About to handle -x '" << batch_command << "'" << endl; + lyxerr << "About to handle -x '" + << batch_command << "'" << endl; // no buffer loaded, create one if (!last_loaded) @@ -568,7 +565,7 @@ void LyX::queryUserLyXDir(bool explicit_userdir) // Run configure in user lyx directory Path p(user_lyxdir); - system(AddName(system_lyxdir, "configure").c_str()); + ::system(AddName(system_lyxdir, "configure").c_str()); lyxerr << "LyX: " << _("Done!") << endl; } @@ -744,25 +741,7 @@ bool LyX::easyParse(int * argc, char * argv[]) if (i + 1 < *argc) { string type(argv[i+1]); removeargs = 2; -#ifdef NEW_EXPORT batch_command = "buffer-export " + type; -#else - if (type == "tex") - type = "latex"; - else if (type == "ps") - type = "postscript"; - else if (type == "text" || type == "txt") - type = "ascii"; - - if (type == "latex" || type == "postscript" - || type == "linuxdoc" || type == "docbook" - || type == "ascii" || type == "html") - batch_command = "buffer-export " + type; - else - lyxerr << _("Unknown file type '") - << type << _("' after ") - << arg << _(" switch!") << endl; -#endif } else lyxerr << _("Missing file type [eg latex, " "ps...] after ") diff --git a/src/lyx_sendfax.C b/src/lyx_sendfax.C index acaf1101e9..d049d9d0d1 100644 --- a/src/lyx_sendfax.C +++ b/src/lyx_sendfax.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -74,7 +74,7 @@ FD_xsendfax *create_form_xsendfax(void) fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_end_form(); - //fdui->xsendfax->fdui = fdui; + fdui->xsendfax->fdui = fdui; return fdui; } @@ -92,7 +92,7 @@ FD_phonebook *create_form_phonebook(void) fl_set_object_callback(obj, cb_select_phoneno, 0); fl_end_form(); - //fdui->phonebook->fdui = fdui; + fdui->phonebook->fdui = fdui; return fdui; } @@ -111,7 +111,7 @@ FD_logfile *create_form_logfile(void) fl_set_object_callback(obj, FaxLogfileCloseCB, 0); fl_end_form(); - //fdui->logfile->fdui = fdui; + fdui->logfile->fdui = fdui; return fdui; } diff --git a/src/lyx_sendfax_main.C b/src/lyx_sendfax_main.C index 0f12f74c6f..c7af0d64a9 100644 --- a/src/lyx_sendfax_main.C +++ b/src/lyx_sendfax_main.C @@ -127,7 +127,7 @@ bool button_send(string const & fname, string const & sendcmd) lyxerr << "CMD: " << cmd << endl; Systemcalls one(Systemcalls::System, cmd); show_logfile(logfile, false); - remove(logfile.c_str()); + lyx::unlink(logfile); return true; } @@ -246,7 +246,7 @@ void cb_delete_phoneno(FL_OBJECT *, long ) void cb_save_phoneno(FL_OBJECT *, long ) { - FILE * fp = fopen(phone_book.c_str(), "w"); + FILE * fp = ::fopen(phone_book.c_str(), "w"); if (!fp) { WriteAlert(_("Error!"), _("Cannot open phone book: "), phone_book); return; diff --git a/src/lyxfr1.C b/src/lyxfr1.C index 13c928b5b5..ca5e9aa51a 100644 --- a/src/lyxfr1.C +++ b/src/lyxfr1.C @@ -136,9 +136,9 @@ void LyXFindReplace::SearchReplaceCB() // clear the selection (if there is any) bv->toggleSelection(false); bv->text-> - ReplaceSelectionWithString(bv, replacestring.c_str()); + ReplaceSelectionWithString(bv, replacestring); bv->text-> - SetSelectionOverString(bv, replacestring.c_str()); + SetSelectionOverString(bv, replacestring); bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); } @@ -179,9 +179,9 @@ void LyXFindReplace::SearchReplaceAllCB() bv->update(BufferView::SELECT|BufferView::FITCUR); bv->toggleSelection(false); bv->text-> - ReplaceSelectionWithString(bv, replacestring.c_str()); + ReplaceSelectionWithString(bv, replacestring); bv->text-> - SetSelectionOverString(bv, replacestring.c_str()); + SetSelectionOverString(bv, replacestring); bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); ++replace_count; } diff --git a/src/lyxfunc.C b/src/lyxfunc.C index bc49c03ddf..662acd8a0f 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -107,16 +107,10 @@ extern bool MenuWriteAs(Buffer *); extern int MenuRunLaTeX(Buffer *); extern int MenuBuildProg(Buffer *); extern int MenuRunChktex(Buffer *); -#ifndef NEW_EXPORT -extern bool CreatePostscript(Buffer *, bool); -#endif extern void MenuPrint(Buffer *); extern void MenuSendto(); extern void QuitLyX(); extern void MenuFax(Buffer *); -#ifndef NEW_EXPORT -extern void MenuExport(Buffer *, string const &); -#endif extern void show_symbols_form(LyXFunc *); extern LyXAction lyxaction; @@ -124,22 +118,11 @@ extern LyXAction lyxaction; extern tex_accent_struct get_accent(kb_action action); extern void AutoSave(BufferView *); -#ifndef NEW_EXPORT -extern bool PreviewDVI(Buffer *); -extern bool PreviewPostscript(Buffer *); -#endif extern void MenuInsertLabel(string const &); extern void MenuLayoutCharacter(); extern void MenuLayoutParagraph(); -extern void MenuLayoutDocument(); -extern void MenuLayoutPaper(); -#if 0 -extern void MenuLayoutTable(int flag); -#endif -extern void MenuLayoutQuotes(); extern void MenuLayoutPreamble(); extern void MenuLayoutSave(); -extern void bulletForm(); extern Buffer * NewLyxFile(string const &); extern void LoadLyXFile(string const &); @@ -486,18 +469,6 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const static bool noLaTeX = lyxrc.latex_command == "none"; bool disable = false; switch (action) { -#ifndef NEW_EXPORT - case LFUN_PREVIEW: - disable = noLaTeX || lyxrc.view_dvi_command == "none"; - break; - case LFUN_PREVIEWPS: - disable = noLaTeX || lyxrc.view_ps_command == "none"; - break; - case LFUN_RUNLATEX: - case LFUN_RUNDVIPS: - disable = noLaTeX; - break; -#endif case LFUN_MENUPRINT: disable = noLaTeX || lyxrc.print_command == "none"; break; @@ -510,27 +481,6 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const else if (argument == "linuxdoc") disable = lyxrc.linuxdoc_to_lyx_command == "none"; break; -#ifndef NEW_EXPORT - case LFUN_EXPORT: - if (argument == "latex") - disable = (! buf->isLatex() && ! buf->isLiterate()) ; - else if (argument == "linuxdoc") - disable = ! buf->isLinuxDoc(); - else if (argument == "docbook") - disable = ! buf->isDocBook(); - else if (argument == "dvi" || argument == "postscript") - disable = noLaTeX; - else if (argument == "html") - disable = (buf->isLinuxDoc() - && lyxrc.linuxdoc_to_html_command == "none") - || (buf->isDocBook() - && lyxrc.docbook_to_html_command == "none") - || (! buf->isLinuxDoc() && ! buf->isDocBook() - && lyxrc.html_command == "none"); - else if (argument == "custom") - disable = (! buf->isLatex() && ! buf->isLiterate()); - break; -#endif case LFUN_UNDO: disable = buf->undostack.empty(); break; @@ -651,7 +601,7 @@ string const LyXFunc::Dispatch(string const & s) string line = frontStrip(s); string arg = strip(frontStrip(split(line, cmd, ' '))); - return Dispatch(lyxaction.LookupFunc(cmd.c_str()), arg); + return Dispatch(lyxaction.LookupFunc(cmd), arg); } @@ -703,7 +653,7 @@ string const LyXFunc::Dispatch(int ac, // this is better pseudoaction = lyxaction.searchActionArg(action, - argument.c_str()); + argument); if (pseudoaction == -1) { pseudoaction = action; @@ -840,8 +790,8 @@ string const LyXFunc::Dispatch(int ac, if (!searched_string.empty() && ((action == LFUN_WORDFINDBACKWARD) ? - ltCur->SearchBackward(owner->view(), searched_string.c_str()) : - ltCur->SearchForward(owner->view(), searched_string.c_str()))) { + ltCur->SearchBackward(owner->view(), searched_string) : + ltCur->SearchForward(owner->view(), searched_string))) { // ??? What is that ??? owner->view()->update(BufferView::SELECT|BufferView::FITCUR); @@ -966,7 +916,6 @@ string const LyXFunc::Dispatch(int ac, reloadBuffer(); break; -#ifdef NEW_EXPORT case LFUN_UPDATE: Exporter::Export(owner->buffer(), argument, true); break; @@ -974,23 +923,6 @@ string const LyXFunc::Dispatch(int ac, case LFUN_PREVIEW: Exporter::Preview(owner->buffer(), argument); break; -#else - case LFUN_PREVIEW: - PreviewDVI(owner->buffer()); - break; - - case LFUN_PREVIEWPS: - PreviewPostscript(owner->buffer()); - break; - - case LFUN_RUNLATEX: - MenuRunLaTeX(owner->buffer()); - break; - - case LFUN_RUNDVIPS: - CreatePostscript(owner->buffer(), false); - break; -#endif case LFUN_BUILDPROG: MenuBuildProg(owner->buffer()); @@ -1009,11 +941,7 @@ string const LyXFunc::Dispatch(int ac, break; case LFUN_EXPORT: -#ifdef NEW_EXPORT Exporter::Export(owner->buffer(), argument, false); -#else - MenuExport(owner->buffer(), argument); -#endif break; case LFUN_IMPORT: @@ -1428,11 +1356,7 @@ string const LyXFunc::Dispatch(int ac, break; case LFUN_LAYOUT_DOCUMENT: -#ifdef USE_OLD_DOCUMENT_LAYOUT - MenuLayoutDocument(); -#else owner->getDialogs()->showLayoutDocument(); -#endif break; case LFUN_LAYOUT_PARAGRAPH: @@ -1447,16 +1371,6 @@ string const LyXFunc::Dispatch(int ac, MenuLayoutCharacter(); break; -#if 0 - case LFUN_LAYOUT_TABLE: - { - int flag = 0; - if (argument == "true") flag = 1; - MenuLayoutTable(flag); - } - break; -#endif - case LFUN_LAYOUT_TABULAR: if (owner->view()->the_locking_inset) { if (owner->view()->the_locking_inset->LyxCode()==Inset::TABULAR_CODE) { @@ -1472,18 +1386,6 @@ string const LyXFunc::Dispatch(int ac, } break; - case LFUN_LAYOUT_PAPER: -#ifdef USE_OLD_DOCUMENT_LAYOUT - MenuLayoutPaper(); -#endif - break; - - case LFUN_LAYOUT_QUOTES: -#ifdef USE_OLD_DOCUMENT_LAYOUT - MenuLayoutQuotes(); -#endif - break; - case LFUN_LAYOUT_PREAMBLE: MenuLayoutPreamble(); break; @@ -1573,7 +1475,7 @@ string const LyXFunc::Dispatch(int ac, break; case LFUN_INSERT_LABEL: - MenuInsertLabel(argument.c_str()); + MenuInsertLabel(argument); break; case LFUN_REF_INSERT: @@ -2405,7 +2307,7 @@ string const LyXFunc::Dispatch(int ac, { int r = 2, c = 2; if (!argument.empty()) - sscanf(argument.c_str(),"%d%d", &r, &c); + ::sscanf(argument.c_str(),"%d%d", &r, &c); InsetTabular * new_inset = new InsetTabular(owner->buffer(), r, c); if (owner->view()->insertInset(new_inset)) @@ -2442,7 +2344,7 @@ string const LyXFunc::Dispatch(int ac, { int x; long y; - sscanf(argument.c_str(), " %d %ld", &x, &y); + ::sscanf(argument.c_str(), " %d %ld", &x, &y); owner->view()->text->SetCursorFromCoordinates(owner->view(), x, y); } break; @@ -2495,7 +2397,7 @@ string const LyXFunc::Dispatch(int ac, { char file_name[100]; int row; - sscanf(argument.c_str(), " %s %d", file_name, &row); + ::sscanf(argument.c_str(), " %s %d", file_name, &row); // Must replace extension of the file to be .lyx and get full path string s = ChangeExtension(string(file_name), ".lyx"); @@ -2535,7 +2437,7 @@ string const LyXFunc::Dispatch(int ac, case LFUN_APROPOS: case LFUN_GETTIP: { - int qa = lyxaction.LookupFunc(argument.c_str()); + int const qa = lyxaction.LookupFunc(argument); setMessage(lyxaction.helpText(static_cast(qa))); } break; @@ -2656,7 +2558,7 @@ string const LyXFunc::Dispatch(int ac, case LFUN_INSERT_MATH: { - math_insert_symbol(argument.c_str()); + math_insert_symbol(argument); } break; @@ -2675,7 +2577,7 @@ string const LyXFunc::Dispatch(int ac, setErrorMessage(N_("Missing argument")); else { string s1 = token(s, ' ', 1); - int na = s1.empty() ? 0: atoi(s1.c_str()); + int na = s1.empty() ? 0 : lyx::atoi(s1); owner->view()-> open_new_inset(new InsetFormulaMacro(token(s, ' ', 0), na)); } @@ -2918,11 +2820,7 @@ string const LyXFunc::Dispatch(int ac, owner->view()->setState(); } break; -#endif - case LFUN_BUFFERBULLETSSELECT: - bulletForm(); - break; - +#endif case LFUN_TOGGLECURSORFOLLOW: cursor_follows_scrollbar = !cursor_follows_scrollbar; break; @@ -2981,7 +2879,7 @@ string const LyXFunc::Dispatch(int ac, else arg = lyxrc.date_insert_format; char datetmp[32]; - int datetmp_len = strftime(datetmp, 32, arg.c_str(), now_tm); + int datetmp_len = ::strftime(datetmp, 32, arg.c_str(), now_tm); for (int i = 0; i < datetmp_len; i++) { owner->view()->text->InsertChar(owner->view(), datetmp[i]); owner->view()->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); diff --git a/src/lyxlex.C b/src/lyxlex.C index 9c23930a74..4dc6bbfa51 100644 --- a/src/lyxlex.C +++ b/src/lyxlex.C @@ -177,7 +177,7 @@ string const LyXLex::getLongString(string const & endtoken) } if (!prefix.empty() - && prefixIs(tmpstr, prefix.c_str())) { + && prefixIs(tmpstr, prefix)) { tmpstr.erase(0, prefix.length() - 1); } str += frontStrip(tmpstr, "\t") + '\n'; diff --git a/src/lyxrc.C b/src/lyxrc.C index 65e42de925..fc7aba494e 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -933,15 +933,14 @@ int LyXRC::read(string const & filename) break; } - if ((action = lyxaction.LookupFunc(cmd.c_str()))>= 0) { + if ((action = lyxaction.LookupFunc(cmd))>= 0) { if (lyxerr.debugging(Debug::KBMAP)) { lyxerr << "RC_BIND: Sequence `" << seq << "' Command `" << cmd << "' Action `" << action << '\'' << endl; } - res = toplevel_keymap->bind(seq.c_str(), - action); + res = toplevel_keymap->bind(seq, action); if (res != 0) { lexrc.printError( "Invalid key sequence `" diff --git a/src/lyxserver.C b/src/lyxserver.C index 375d506e96..76a7d19975 100644 --- a/src/lyxserver.C +++ b/src/lyxserver.C @@ -55,6 +55,7 @@ #include "debug.h" #include "LyXAction.h" #include "support/lstrings.h" +#include "support/lyxlib.h" #ifdef __EMX__ #include @@ -115,7 +116,7 @@ void LyXComm::openConnection() { NP_NOWAIT|0x01, 0600, 0600, 0); if (rc == ERROR_PIPE_BUSY) { #else - if (access(tmp.c_str(), F_OK) == 0) { + if (::access(tmp.c_str(), F_OK) == 0) { #endif lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n" << "If no other LyX program is active, please delete" @@ -124,12 +125,12 @@ void LyXComm::openConnection() { return; } #ifndef __EMX__ - if (mkfifo(tmp.c_str(), 0600) < 0) { + if (::mkfifo(tmp.c_str(), 0600) < 0) { lyxerr << "LyXComm: Could not create pipe " << tmp << '\n' << strerror(errno) << endl; return; }; - infd = open(tmp.c_str(), O_RDONLY|O_NONBLOCK); + infd = ::open(tmp.c_str(), O_RDONLY|O_NONBLOCK); #else if (rc != NO_ERROR) { errnum = TranslateOS2Error(rc); @@ -161,7 +162,7 @@ void LyXComm::openConnection() { tmp = pipename + ".out"; #ifndef __EMX__ - if (access(tmp.c_str(), F_OK) == 0) { + if (::access(tmp.c_str(), F_OK) == 0) { #else rc = DosCreateNPipe(tmp.c_str(), &fd, NP_ACCESS_DUPLEX, NP_NOWAIT|0x01, 0600, 0600, 0); @@ -175,17 +176,17 @@ void LyXComm::openConnection() { return; } #ifndef __EMX__ - if (mkfifo(tmp.c_str(), 0600) < 0) { + if (::mkfifo(tmp.c_str(), 0600) < 0) { lyxerr << "LyXComm: Could not create pipe " << tmp << '\n' << strerror(errno) << endl; return; }; - if (access(tmp.c_str(), F_OK) != 0) { + if (::access(tmp.c_str(), F_OK) != 0) { lyxerr << "LyXComm: Pipe " << tmp << " does not exist" << endl; return; } - outfd = open(tmp.c_str(), O_RDWR); + outfd = ::open(tmp.c_str(), O_RDWR); #else if (rc != NO_ERROR) { errnum = TranslateOS2Error(rc); @@ -257,7 +258,7 @@ void LyXComm::closeConnection() { << '\n' << strerror(errno) << endl; } #ifndef __EMX__ // OS/2 named pipes will be automatically removed. - if (unlink(tmp.c_str()) < 0){ + if (lyx::unlink(tmp) < 0){ lyxerr << "LyXComm: Could not remove pipe " << tmp << '\n' << strerror(errno) << endl; }; @@ -274,12 +275,12 @@ void LyXComm::closeConnection() { return; } #endif - if (close(outfd) < 0) { + if (::close(outfd) < 0) { lyxerr << "LyXComm: Could not close pipe " << tmp << '\n' << strerror(errno) << endl; } #ifndef __EMX__ - if (unlink(tmp.c_str()) < 0){ + if (lyx::unlink(tmp) < 0){ lyxerr << "LyXComm: Could not remove pipe " << tmp << '\n' << strerror(errno) << endl; }; @@ -375,7 +376,7 @@ void LyXComm::send(string const & msg) { if (!ready) { lyxerr << "LyXComm: Pipes are closed. Could not send " << msg << endl; - } else if (write(outfd, msg.c_str(), msg.length()) < 0) { + } else if (::write(outfd, msg.c_str(), msg.length()) < 0) { lyxerr << "LyXComm: Error sending message: " << msg << '\n' << strerror(errno) << "\nLyXComm: Resetting connection" << endl; @@ -421,7 +422,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg) lyxerr[Debug::LYXSERVER] << "LyXServer: Received: '" << msg << '\'' << endl; - char const *p = msg.c_str(); + char const * p = msg.c_str(); // --- parse the string -------------------------------------------- // @@ -523,7 +524,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg) // connect to the lyxfunc in the single LyXView we // support currently. (Lgb) - int action = lyxaction.LookupFunc(cmd.c_str()); + int action = lyxaction.LookupFunc(cmd); //int action = -1; string rval, buf; diff --git a/src/lyxtext.h b/src/lyxtext.h index 548d035c45..55dbb9e0f9 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -284,10 +284,6 @@ public: /// void CursorRight(BufferView *, bool internal = true) const; /// - void CursorLeftIntern(BufferView *, bool internal = true) const; - /// - void CursorRightIntern(BufferView *, bool internal = true) const; - /// void CursorLeftOneWord(BufferView *) const; /// void CursorRightOneWord(BufferView *) const; diff --git a/src/lyxvc.C b/src/lyxvc.C index ba4529c6dd..4ab17afc9c 100644 --- a/src/lyxvc.C +++ b/src/lyxvc.C @@ -295,5 +295,5 @@ void LyXVC::showLog() string tmpf = tmpnam(0); vcs->getLog(tmpf); viewLog(tmpf); - unlink(tmpf.c_str()); + lyx::unlink(tmpf); } diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 414cf47115..e4a457621d 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -45,7 +45,8 @@ using std::endl; using std::vector; using std::max; -extern char * mathed_label; +//extern char * mathed_label; +extern string mathed_label; extern char const * latex_special_chars; @@ -325,7 +326,7 @@ int InsetFormula::Latex(Buffer const *, ostream & os, bool fragile, bool) const int ret = 0; //#warning Alejandro, the number of lines is not returned in this case // This problem will disapear at 0.13. - mathed_write(par, os, &ret, fragile, label.c_str()); + mathed_write(par, os, &ret, fragile, label); return ret; } @@ -365,7 +366,9 @@ void InsetFormula::Read(Buffer const *, LyXLex & lex) mathed_parser_file(is, lex.GetLineNo()); // Silly hack to read labels. - mathed_label = 0; + //mathed_label = 0; + mathed_label.erase(); + mathed_parse(0, 0, &par); par->Metrics(); disp_flag = (par->GetType() > 0); @@ -373,9 +376,11 @@ void InsetFormula::Read(Buffer const *, LyXLex & lex) // Update line number lex.setLineNo(mathed_parser_lineno()); - if (mathed_label) { + //if (mathed_label) { + if (!mathed_label.empty()) { label = mathed_label; - mathed_label = 0; + //mathed_label = 0; + mathed_label.erase(); } // reading of end_inset in the inset!!! @@ -941,7 +946,7 @@ InsetFormula::LocalDispatch(BufferView * bv, case LFUN_MATH_SIZE: if (!arg.empty()) { - latexkeys * l = in_word_set (arg.c_str(), strlen(arg.c_str())); + latexkeys * l = in_word_set (arg); int sz = (l) ? l->id: -1; mathcursor->SetSize(sz); UpdateLocal(bv); @@ -951,7 +956,7 @@ InsetFormula::LocalDispatch(BufferView * bv, case LFUN_INSERT_MATH: { bv->lockedInsetStoreUndo(Undo::INSERT); - InsertSymbol(bv, arg.c_str()); + InsertSymbol(bv, arg); break; } @@ -997,7 +1002,7 @@ InsetFormula::LocalDispatch(BufferView * bv, if (n > 0) { if (isdigit(lf[0])) - ilf = atoi(lf); + ilf = lyx::atoi(lf); else if (lf[1]) { l = in_word_set(lf, strlen(lf)); @@ -1009,7 +1014,7 @@ InsetFormula::LocalDispatch(BufferView * bv, if (n > 1) { if (isdigit(rg[0])) - irg = atoi(rg); + irg = lyx::atoi(rg); else if (rg[1]) { l = in_word_set(rg, strlen(rg)); @@ -1051,7 +1056,7 @@ InsetFormula::LocalDispatch(BufferView * bv, if (!lb.empty() && lb[0] > ' ') { SetNumber(true); if (par->GetType() == LM_OT_MPARN) { - mathcursor->setLabel(lb.c_str()); + mathcursor->setLabel(lb); // MathMatrixInset *mt = (MathMatrixInset*)par; // mt->SetLabel(lb); } else { diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index 53b9b01505..638ef72d1d 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -45,7 +45,7 @@ InsetFormulaMacro::InsetFormulaMacro() InsetFormulaMacro::InsetFormulaMacro(string nm, int na, bool /*e*/) : InsetFormula(true), name(nm) { - tmacro = MathMacroTable::mathMTable.getTemplate(name.c_str()); + tmacro = MathMacroTable::mathMTable.getTemplate(name); if (!tmacro) { tmacro = new MathMacroTemplate(name.c_str(), na); MathMacroTable::mathMTable.addTemplate(tmacro); @@ -206,7 +206,7 @@ InsetFormulaMacro::LocalDispatch(BufferView * bv, int action, string const & arg) { if (action == LFUN_MATH_MACROARG) { - int i = atoi(arg.c_str()) - 1; + int i = lyx::atoi(arg) - 1; if (i >= 0 && i < tmacro->getNoArgs()) { mathcursor->Insert(tmacro->getMacroPar(i), LM_TC_INSET); InsetFormula::UpdateLocal(bv); diff --git a/src/mathed/math_forms.C b/src/mathed/math_forms.C index 027abca627..fab0382dd0 100644 --- a/src/mathed/math_forms.C +++ b/src/mathed/math_forms.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -55,7 +55,7 @@ FD_panel *create_form_panel(void) fl_set_object_callback(obj, button_cb, MM_SQRT); fdui->frac = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 40, 15, 30, 30, ""); fl_set_object_color(obj, FL_MCOL, FL_BLUE); - fl_set_object_lcol(obj, FL_COL1); + fl_set_object_lcolor(obj, FL_COL1); fl_set_object_callback(obj, button_cb, MM_FRAC); fdui->delim = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 10, 50, 30, 30, ""); fl_set_object_color(obj, FL_MCOL, FL_BLUE); @@ -71,7 +71,7 @@ FD_panel *create_form_panel(void) fl_set_object_callback(obj, button_cb, MM_SPACE); fl_end_form(); - //fdui->panel->fdui = fdui; + fdui->panel->fdui = fdui; return fdui; } @@ -85,7 +85,7 @@ FD_delim *create_form_delim(void) fdui->delim = fl_bgn_form(FL_NO_BOX, 250, 260); obj = fl_add_box(FL_UP_BOX, 0, 0, 250, 260, ""); fdui->menu = obj = fl_add_bmtable(FL_PUSH_BUTTON, 40, 70, 170, 140, ""); - fl_set_object_lcol(obj, FL_BLUE); + fl_set_object_lcolor(obj, FL_BLUE); fl_set_object_callback(obj, delim_cb, 2); fdui->lado = fl_bgn_group(); @@ -111,7 +111,7 @@ FD_delim *create_form_delim(void) fl_set_object_callback(obj, delim_cb, MM_OK); fl_end_form(); - //fdui->delim->fdui = fdui; + fdui->delim->fdui = fdui; return fdui; } @@ -158,7 +158,7 @@ FD_matrix *create_form_matrix(void) fl_set_object_callback(obj, matrix_cb, MM_APPLY); fl_end_form(); - //fdui->matrix->fdui = fdui; + fdui->matrix->fdui = fdui; return fdui; } @@ -172,14 +172,14 @@ FD_deco *create_form_deco(void) fdui->deco = fl_bgn_form(FL_NO_BOX, 160, 150); obj = fl_add_box(FL_UP_BOX, 0, 0, 160, 150, ""); fdui->menu = obj = fl_add_bmtable(FL_PUSH_BUTTON, 10, 10, 140, 90, ""); - fl_set_object_lcol(obj, FL_BLUE); + fl_set_object_lcolor(obj, FL_BLUE); fl_set_object_callback(obj, deco_cb, MM_APPLY); obj = fl_add_button(FL_RETURN_BUTTON, 30, 110, 100, 30, _("Close")); fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_callback(obj, deco_cb, MM_CLOSE); fl_end_form(); - //fdui->deco->fdui = fdui; + fdui->deco->fdui = fdui; return fdui; } @@ -231,7 +231,7 @@ FD_space *create_form_space(void) fl_end_form(); - //fdui->space->fdui = fdui; + fdui->space->fdui = fdui; return fdui; } diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index 4b5660f3f0..3e77dc9f26 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -376,7 +376,7 @@ MathedInset * MathMatrixInset::Clone() void MathMatrixInset::SetAlign(char vv, string const & hh) { v_align = vv; - strncpy(h_align, hh.c_str(), nc); + ::strncpy(h_align, hh.c_str(), nc); } diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 6783576340..6b7313341e 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -254,7 +254,7 @@ void MathMacroArgument::Write(ostream & os, bool fragile) /* --------------------- MathMacroTemplate ---------------------------*/ -MathMacroTemplate::MathMacroTemplate(char const * nm, int na, int flg): +MathMacroTemplate::MathMacroTemplate(string const & nm, int na, int flg): MathParInset(LM_ST_TEXT, nm, LM_OT_MACRO), flags(flg), nargs(na) { diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index f57f09098e..800cf83c55 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -142,7 +142,7 @@ class MathMacroTemplate: public MathParInset { public: /// A template constructor needs all the data explicit - MathMacroTemplate(char const *, int na = 0, int f = 0); + MathMacroTemplate(string const &, int na = 0, int f = 0); /// ~MathMacroTemplate(); /// diff --git a/src/mathed/math_panel.C b/src/mathed/math_panel.C index ae48f1fc2c..b2f48bf3c3 100644 --- a/src/mathed/math_panel.C +++ b/src/mathed/math_panel.C @@ -195,10 +195,10 @@ void matrix_cb(FL_OBJECT *, long data) case MM_APPLY: case MM_OK: { - char c = v_align_c[fl_get_choice(fd_matrix->valign)-1]; + char c = v_align_c[fl_get_choice(fd_matrix->valign) - 1]; char const * sh = fl_get_input(fd_matrix->halign); - int nx = int(fl_get_slider_value(fd_matrix->columns)+0.5); - int ny = int(fl_get_slider_value(fd_matrix->rows)+0.5); + int nx = int(fl_get_slider_value(fd_matrix->columns) + 0.5); + int ny = int(fl_get_slider_value(fd_matrix->rows) + 0.5); if (data == MM_OK) fl_hide_form(fd_matrix->matrix); std::ostringstream ost; ost << nx << ' ' << ny << ' ' << c << sh; diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 9d08906c89..26a88be831 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -16,7 +16,7 @@ */ #include -#include + #include #ifdef __GNUG__ @@ -29,6 +29,7 @@ #include "math_macro.h" #include "math_root.h" #include "debug.h" +#include "support/lyxlib.h" using std::istream; using std::endl; @@ -45,12 +46,15 @@ enum { FLAG_BRACK_END = 256 // Next ] ends the parsing process }; +static YYSTYPE yylval; -static short mathed_env = LM_EN_INTEXT; +static +short mathed_env = LM_EN_INTEXT; + +string mathed_label; -char * mathed_label = 0; char const * latex_mathenv[] = { "math", @@ -62,10 +66,12 @@ char const * latex_mathenv[] = { }; + char const * latex_mathspace[] = { "!", ",", ":", ";", "quad", "qquad" }; - + + char const * latex_special_chars = "#$%&_{}"; // These are lexical codes, not semantic @@ -92,15 +98,6 @@ static int yylineno; static istream * yyis; static bool yy_mtextmode= false; -static inline -char * strnew(char const * s) -{ - char * s1 = new char[strlen(s) + 1]; // this leaks when not delete[]'ed - strcpy(s1, s); - return s1; -} - - static void mathPrintError(string const & msg) { @@ -142,9 +139,6 @@ void LexInitCodes() static char LexGetArg(char lf, bool accept_spaces= false) { - char rg; - char * p = &yytext[0]; - int bcnt = 1; unsigned char c; char cc; while (yyis->good()) { @@ -158,18 +152,21 @@ char LexGetArg(char lf, bool accept_spaces= false) break; } } - rg = (lf == '{') ? '}': ((lf == '[') ? ']': ((lf == '(') ? ')': 0)); + char const rg = + (lf == '{') ? '}' : ((lf == '[') ? ']' : ((lf == '(') ? ')' : 0)); if (!rg) { lyxerr << "Math parse error: unknown bracket '" << lf << "'" << endl; return '\0'; - } + } + char * p = &yytext[0]; + int bcnt = 1; do { yyis->get(cc); c = cc; if (c == lf) ++bcnt; if (c == rg) --bcnt; - if ((c > ' ' || (c == ' ' && accept_spaces)) && bcnt>0) *(p++) = c; + if ((c > ' ' || (c == ' ' && accept_spaces)) && bcnt > 0) *(p++) = c; } while (bcnt > 0 && yyis->good()); *p = '\0'; return rg; @@ -180,11 +177,11 @@ static int yylex(void) { static int init_done = 0; - unsigned char c; - char cc; if (!init_done) LexInitCodes(); + unsigned char c; + char cc; while (yyis->good()) { yyis->get(cc); c = cc; @@ -192,45 +189,79 @@ int yylex(void) if (yy_mtextmode && c == ' ') { yylval.i= ' '; return LM_TK_ALPHA; - } + } else if (lexcode[c] == LexNewLine) { ++yylineno; continue; - } + } else - if (lexcode[c] == LexComment) - do { yyis->get(cc); c = cc; } while (c != '\n' % yyis->good()); // eat comments - - if (lexcode[c] == LexDigit || lexcode[c] == LexOther || lexcode[c] == LexMathSpace) { yylval.i = c; return LM_TK_STR; } - if (lexcode[c] == LexAlpha) { yylval.i= c; return LM_TK_ALPHA; } - if (lexcode[c] == LexBOP) { yylval.i= c; return LM_TK_BOP; } - if (lexcode[c] == LexSelf) { return c; } + if (lexcode[c] == LexComment) { + do { + yyis->get(cc); + c = cc; + } while (c != '\n' % yyis->good()); // eat comments + } else + + if (lexcode[c] == LexDigit + || lexcode[c] == LexOther + || lexcode[c] == LexMathSpace) { + yylval.i = c; + return LM_TK_STR; + } else + if (lexcode[c] == LexAlpha) { + yylval.i= c; + return LM_TK_ALPHA; + } else + if (lexcode[c] == LexBOP) { + yylval.i= c; + return LM_TK_BOP; + } else + if (lexcode[c] == LexSelf) { + return c; + } else if (lexcode[c] == LexArgument) { yyis->get(cc); c = cc; yylval.i = c - '0'; return LM_TK_ARGUMENT; - } - if (lexcode[c] == LexOpen) { return LM_TK_OPEN; } - if (lexcode[c] == LexClose) { return LM_TK_CLOSE; } - + } else + if (lexcode[c] == LexOpen) { + return LM_TK_OPEN; + } else + if (lexcode[c] == LexClose) { + return LM_TK_CLOSE; + } else if (lexcode[c] == LexESC) { yyis->get(cc); c = cc; - if (c == '\\') { return LM_TK_NEWLINE; } - if (c == '(') { yylval.i = LM_EN_INTEXT; return LM_TK_BEGIN; } - if (c == ')') { yylval.i = LM_EN_INTEXT; return LM_TK_END; } - if (c == '[') { yylval.i = LM_EN_DISPLAY; return LM_TK_BEGIN; } - if (c == ']') { yylval.i = LM_EN_DISPLAY; return LM_TK_END; } + if (c == '\\') { + return LM_TK_NEWLINE; + } + if (c == '(') { + yylval.i = LM_EN_INTEXT; + return LM_TK_BEGIN; + } + if (c == ')') { + yylval.i = LM_EN_INTEXT; + return LM_TK_END; + } + if (c == '[') { + yylval.i = LM_EN_DISPLAY; + return LM_TK_BEGIN; + } + if (c == ']') { + yylval.i = LM_EN_DISPLAY; + return LM_TK_END; + } if (strchr(latex_special_chars, c)) { yylval.i = c; return LM_TK_SPECIAL; - } + } if (lexcode[c] == LexMathSpace) { int i; for (i = 0; i < 4 && static_cast(c) != latex_mathspace[i][0]; ++i); - yylval.i = (i < 4) ? i: 0; + yylval.i = (i < 4) ? i : 0; return LM_TK_SPACE; } if (lexcode[c] == LexAlpha || lexcode[c] == LexDigit) { @@ -270,6 +301,7 @@ int yylex(void) } +static int parse_align(char * hor, char *) { int nc = 0; @@ -279,9 +311,12 @@ int parse_align(char * hor, char *) // Accent hacks only for 0.12. Stolen from Cursor. +static int accent = 0; +static int nestaccent[8]; +static void setAccent(int ac) { if (ac > 0 && accent < 8) { @@ -291,6 +326,7 @@ void setAccent(int ac) } +static MathedInset * doAccent(byte c, MathedTextCodes t) { MathedInset * ac = 0; @@ -307,6 +343,7 @@ MathedInset * doAccent(byte c, MathedTextCodes t) } +static MathedInset * doAccent(MathedInset * p) { MathedInset * ac = 0; @@ -326,13 +363,14 @@ MathedInset * doAccent(MathedInset * p) LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, MathParInset ** mtx) { - int t = yylex(), tprev = 0; + int t = yylex(); + int tprev = 0; bool panic = false; static int plevel = -1; static int size = LM_ST_TEXT; MathedTextCodes varcode = LM_TC_VAR; MathedInset * binset = 0; - static MathMacroTemplate * macro= 0; + static MathMacroTemplate * macro = 0; int brace = 0; int acc_brace = 0; @@ -375,15 +413,15 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, int na = 0; LexGetArg('{'); - // This name lives until quitting, for that reason - // I didn't care on deleting explicitly. Later I will. - char const * name = strnew(&yytext[1]); + string const name(&yytext[1]); + // ugly trick to be removed soon (lyx3) - char c; yyis->get(c); - yyis->putback(c); + //char c; yyis->get(c); + //yyis->putback(c); + char const c = yyis->peek(); if (c == '[') { LexGetArg('['); - na = atoi(yytext); + na = lyx::atoi(yytext); } macro = new MathMacroTemplate(name, na); flags = FLAG_BRACE|FLAG_BRACE_LAST; @@ -399,7 +437,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, case LM_TK_STR: { if (accent) { - data.Insert(doAccent(yylval.i, LM_TC_CONST)); + data.Insert(doAccent(yylval.i, LM_TC_CONST)); } else data.Insert (yylval.i, LM_TC_CONST); break; @@ -454,8 +492,8 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, { if (flags & FLAG_BRACK_ARG) { flags &= ~FLAG_BRACK_ARG; - char rg = LexGetArg('['); - if (rg!= ']') { + char const rg = LexGetArg('['); + if (rg != ']') { mathPrintError("Expected ']'"); panic = true; break; @@ -541,7 +579,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, if (accent) { data.Insert(doAccent(yylval.l->id, tc)); } else - data.Insert (yylval.l->id, tc); + data.Insert(yylval.l->id, tc); } else { MathFuncInset * bg = new MathFuncInset(yylval.l->name); if (accent) { @@ -556,7 +594,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, if (accent) { data.Insert(doAccent(yylval.i, LM_TC_BOP)); } else - data.Insert (yylval.i, LM_TC_BOP); + data.Insert(yylval.i, LM_TC_BOP); break; } case LM_TK_STY: @@ -613,13 +651,12 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, case LM_TK_LEFT: { - int lfd, rgd; - lfd = yylex(); + int lfd = yylex(); if (lfd == LM_TK_SYM || lfd == LM_TK_STR || lfd == LM_TK_BOP|| lfd == LM_TK_SPECIAL) lfd = (lfd == LM_TK_SYM) ? yylval.l->id: yylval.i; // lyxerr << "L[" << lfd << " " << lfd << "]"; LyxArrayBase * a = mathed_parse(FLAG_RIGHT); - rgd = yylex(); + int rgd = yylex(); // lyxerr << "R[" << rgd << "]"; if (rgd == LM_TK_SYM || rgd == LM_TK_STR || rgd == LM_TK_BOP || rgd == LM_TK_SPECIAL) rgd = (rgd == LM_TK_SYM) ? yylval.l->id: yylval.i; @@ -657,7 +694,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, break; } - case LM_TK_ACCENT: setAccent(yylval.l->id); break; + case LM_TK_ACCENT: + setAccent(yylval.l->id); + break; case LM_TK_NONUM: { @@ -729,13 +768,12 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, rg = LexGetArg('{'); } strcpy(ar, yytext); - int nc = parse_align(ar, ar2); + int const nc = parse_align(ar, ar2); MathParInset * mm = new MathMatrixInset(nc, 0); mm->SetAlign(ar2[0], ar); data.Insert(mm, LM_TC_ACTIVE_INSET); mathed_parse(FLAG_END, mm->GetData(), &mm); - } else - if (yylval.i >= LM_EN_INTEXT && yylval.i<= LM_EN_EQNARRAY) { + } else if (yylval.i >= LM_EN_INTEXT && yylval.i<= LM_EN_EQNARRAY) { if (plevel!= 0) { mathPrintError("Misplaced environment"); break; @@ -797,7 +835,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, case LM_TK_LABEL: { - char rg = LexGetArg('\0', true); + char const rg = LexGetArg('\0', true); if (rg != '}') { mathPrintError("Expected '{'"); // debug info @@ -806,15 +844,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, break; } if (crow) { - // This is removed by crow's destructor. Bad design? yes, this - // will be changed after 0.12 - crow->setLabel(strnew(yytext)); - } - else { - // where is this math_label free'ed? - // Supposedly in ~formula, another bad hack, - // give me some time please. - mathed_label = strnew(yytext); + crow->setLabel(yytext); + } else { + mathed_label = yytext; } #ifdef DEBUG lyxerr << "Label[" << mathed_label << "]" << endl; @@ -831,7 +863,9 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array, if (panic) { lyxerr << " Math Panic, expect problems!" << endl; // Search for the end command. - do t = yylex (); while (t != LM_TK_END && t); + do { + t = yylex (); + } while (t != LM_TK_END && t); } else t = yylex (); diff --git a/src/mathed/math_parser.h b/src/mathed/math_parser.h index a999664230..ca45c646ce 100644 --- a/src/mathed/math_parser.h +++ b/src/mathed/math_parser.h @@ -136,6 +136,4 @@ union YYSTYPE { latexkeys * l; }; -extern YYSTYPE yylval; - #endif diff --git a/src/paragraph.C b/src/paragraph.C index 24796fd0f7..b28a66e4d8 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1955,7 +1955,7 @@ void LyXParagraph::SetOnlyLayout(BufferParams const & bparams, p1 = ppar->pextra_width, p2 = ppar->pextra_widthp; ppar->SetPExtraType(bparams, ppar->pextra_type, - p1.c_str(), p2.c_str()); + p1, p2); } if ((par->pextra_type == PEXTRA_NONE) && npar && (npar->pextra_type != PEXTRA_NONE)) { @@ -1963,7 +1963,7 @@ void LyXParagraph::SetOnlyLayout(BufferParams const & bparams, p1 = npar->pextra_width, p2 = npar->pextra_widthp; npar->SetPExtraType(bparams, npar->pextra_type, - p1.c_str(), p2.c_str()); + p1, p2); } } } @@ -2024,7 +2024,7 @@ void LyXParagraph::SetLayout(BufferParams const & bparams, p1 = ppar->pextra_width, p2 = ppar->pextra_widthp; ppar->SetPExtraType(bparams, ppar->pextra_type, - p1.c_str(), p2.c_str()); + p1, p2); } if ((par->pextra_type == PEXTRA_NONE) && npar && (npar->pextra_type != PEXTRA_NONE)) { @@ -2032,7 +2032,7 @@ void LyXParagraph::SetLayout(BufferParams const & bparams, p1 = npar->pextra_width, p2 = npar->pextra_widthp; npar->SetPExtraType(bparams, npar->pextra_type, - p1.c_str(), p2.c_str()); + p1, p2); } } } @@ -3468,7 +3468,6 @@ LyXParagraph * LyXParagraph::TeXFootnote(Buffer const * buf, need_closing = true; } - //BufferParams * params = ¤t_view->buffer()->params; bool footer_in_body = true; switch (footnotekind) { case LyXParagraph::FOOTNOTE: @@ -3507,7 +3506,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(Buffer const * buf, << pextra_width << "}\n"; else os << "\\begin{floatingfigure}{" - << atoi(pextra_widthp.c_str())/100.0 + << lyx::atoi(pextra_widthp) / 100.0 << "\\textwidth}\n"; } else { os << "\\begin{figure}"; @@ -3989,7 +3988,7 @@ string const LyXParagraph::String(Buffer const * buffer, } -void LyXParagraph::SetInsetOwner(Inset *i) +void LyXParagraph::SetInsetOwner(Inset * i) { inset_owner = i; for (InsetList::const_iterator cit = insetlist.begin(); diff --git a/src/print_form.C b/src/print_form.C index 1b8867f218..b2665d7772 100644 --- a/src/print_form.C +++ b/src/print_form.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -51,7 +51,7 @@ FD_form_sendto *create_form_form_sendto(void) fl_end_form(); - //fdui->form_sendto->fdui = fdui; + fdui->form_sendto->fdui = fdui; return fdui; } diff --git a/src/sp_form.C b/src/sp_form.C index 474efbffd4..ebc087bf62 100644 --- a/src/sp_form.C +++ b/src/sp_form.C @@ -1,4 +1,4 @@ -// File modified by fdfix.sh for use by lyx (with xforms 0.81) and gettext +// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext #include #include "lyx_gui_misc.h" #include "gettext.h" @@ -65,7 +65,7 @@ FD_form_spell_options *create_form_form_spell_options(void) fl_set_object_callback(obj, SpellOptionsApplyCB, 0); fl_end_form(); - //fdui->form_spell_options->fdui = fdui; + fdui->form_spell_options->fdui = fdui; return fdui; } @@ -118,7 +118,7 @@ FD_form_spell_check *create_form_form_spell_check(void) fl_set_object_lalign(obj, FL_ALIGN_LEFT); fl_end_form(); - //fdui->form_spell_check->fdui = fdui; + fdui->form_spell_check->fdui = fdui; return fdui; } diff --git a/src/spellchecker.C b/src/spellchecker.C index 59b20baeb2..81153c61e0 100644 --- a/src/spellchecker.C +++ b/src/spellchecker.C @@ -488,7 +488,7 @@ bool sc_still_alive() { static void sc_clean_up_after_error() { - fclose(out); + ::fclose(out); } // Send word to ispell and get reply @@ -497,11 +497,11 @@ isp_result * sc_check_word(string const & word) { //Please rewrite to use string. - fputs(word.c_str(), out); - fputc('\n', out); + ::fputs(word.c_str(), out); + ::fputc('\n', out); char buf[1024]; - fgets(buf, 1024, in); + ::fgets(buf, 1024, in); /* I think we have to check if ispell is still alive here because the signal-handler could have disabled blocking on the fd */ @@ -565,28 +565,28 @@ void close_spell_checker() static inline void sc_insert_word(string const & word) { - fputc('*', out); // Insert word in personal dictionary - fputs(word.c_str(), out); - fputc('\n', out); + ::fputc('*', out); // Insert word in personal dictionary + ::fputs(word.c_str(), out); + ::fputc('\n', out); } static inline void sc_accept_word(string const & word) { - fputc('@', out); // Accept in this session - fputs(word.c_str(), out); - fputc('\n', out); + ::fputc('@', out); // Accept in this session + ::fputs(word.c_str(), out); + ::fputc('\n', out); } static inline void sc_store_replacement(string const & mis, string const & cor) { if(actual_spell_checker == ASC_ASPELL) { - fputs("$$ra ", out); - fputs(mis.c_str(), out); - fputc(',', out); - fputs(cor.c_str(), out); - fputc('\n', out); + ::fputs("$$ra ", out); + ::fputs(mis.c_str(), out); + ::fputc(',', out); + ::fputs(cor.c_str(), out); + ::fputc('\n', out); } } @@ -599,7 +599,7 @@ void init_spell_checker(BufferParams const &, string const & lang) { PspellConfig * config = new_pspell_config(); string code; - (void)split(lang, code, '_'); + split(lang, code, '_'); config->replace("language-tag", code.c_str()); spell_error_object = new_pspell_manager(config); if (pspell_error_number(spell_error_object) != 0) { @@ -629,6 +629,7 @@ static isp_result * sc_check_word(string const & word) { isp_result * result = new isp_result; +#warning Why isnt word_ok a bool? (Lgb) int word_ok = pspell_manager_check(sc, word.c_str()); Assert(word_ok != -1); @@ -726,12 +727,12 @@ void ShowSpellChecker(BufferView * bv) fl_set_object_lcol(fd_form_spell_check->input, FL_INACTIVE); fl_set_object_lcol(fd_form_spell_check->browser, FL_INACTIVE); - while (true){ + while (true) { obj = fl_do_forms(); - if (obj == fd_form_spell_check->options){ + if (obj == fd_form_spell_check->options) { SpellCheckerOptions(); } - if (obj == fd_form_spell_check->start){ + if (obj == fd_form_spell_check->start) { // activate insert, accept, and stop fl_activate_object(fd_form_spell_check->insert); fl_activate_object(fd_form_spell_check->accept); diff --git a/src/support/FileInfo.C b/src/support/FileInfo.C index 1d2b9b88f4..3bc18c1231 100644 --- a/src/support/FileInfo.C +++ b/src/support/FileInfo.C @@ -140,9 +140,9 @@ void FileInfo::init() void FileInfo::dostat(bool link) { if (link) { - status = lstat(fname.c_str(), &buf); + status = ::lstat(fname.c_str(), &buf); } else { - status = stat(fname.c_str(), &buf); + status = ::stat(fname.c_str(), &buf); } if (status) err = errno; } @@ -386,3 +386,6 @@ bool FileInfo::access(int p) return false; } } + + + diff --git a/src/support/LRegex.C b/src/support/LRegex.C index aaec005645..c6c1e938ce 100644 --- a/src/support/LRegex.C +++ b/src/support/LRegex.C @@ -59,9 +59,9 @@ struct LRegex::Impl { { regmatch_t tmp; regexec(preg, str.c_str(), 1, &tmp, 0); - unsigned int first = tmp.rm_so != -1 ? + unsigned int const first = tmp.rm_so != -1 ? static_cast(tmp.rm_so) : string::npos; - unsigned int second = tmp.rm_eo != -1 ? + unsigned int const second = tmp.rm_eo != -1 ? static_cast(tmp.rm_eo) : string::npos; return make_pair(first, second - first); } @@ -72,7 +72,7 @@ struct LRegex::Impl { size_t nr = regerror(error_code, preg, 0, 0); char * tmp = new char[nr]; regerror(error_code, preg, tmp, nr); - string ret(tmp); + string const ret(tmp); delete [] tmp; return ret; } @@ -88,7 +88,8 @@ struct LRegex::Impl { // func much faster, but client code will be simpler, // because then it will only be needed to scan through // all the entries in matches. - size_t subs = (preg->re_nsub != 0 ? (preg->re_nsub + 1) : 1); + size_t const subs = + (preg->re_nsub != 0 ? (preg->re_nsub + 1) : 1); regmatch_t * mat = new regmatch_t[subs]; unsigned int first = 0; unsigned int second = 0; diff --git a/src/support/LSubstring.C b/src/support/LSubstring.C index 3b9d1c3792..21c5d54c67 100644 --- a/src/support/LSubstring.C +++ b/src/support/LSubstring.C @@ -43,7 +43,7 @@ LSubstring::LSubstring(string & s, string::value_type const * p) LSubstring::LSubstring(string & s, LRegex const & r) : ps(&s) { - LRegex::MatchPair res = r.first_match(s); + LRegex::MatchPair const res = r.first_match(s); if (res.first != string::npos) { n = res.second; pos = res.first; diff --git a/src/support/Makefile.am b/src/support/Makefile.am index 5fe7a45640..6d5bcb61cb 100644 --- a/src/support/Makefile.am +++ b/src/support/Makefile.am @@ -31,6 +31,7 @@ libsupport_la_SOURCES = \ StrPool.C \ StrPool.h \ abort.C \ + atoi.C \ block.h \ chdir.C \ copy.C \ @@ -52,6 +53,7 @@ libsupport_la_SOURCES = \ path.h \ putenv.C \ rename.C \ + rmdir.C \ sstream.h \ $(REGEX) syscall.C \ syscall.h \ @@ -60,4 +62,5 @@ libsupport_la_SOURCES = \ syssingleton.C \ translator.h \ textutils.h \ + unlink.C \ utility.hpp diff --git a/src/support/StrPool.C b/src/support/StrPool.C index 17d9bab865..2bbc1e06f0 100644 --- a/src/support/StrPool.C +++ b/src/support/StrPool.C @@ -17,7 +17,7 @@ StrPool::~StrPool() { - for (Pool::const_iterator cit = pool_.begin() ; + for (Pool::const_iterator cit = pool_.begin(); cit != pool_.end() ; ++cit) { delete[] (*cit); } diff --git a/src/support/atoi.C b/src/support/atoi.C new file mode 100644 index 0000000000..2e9b3ed580 --- /dev/null +++ b/src/support/atoi.C @@ -0,0 +1,10 @@ +#include + +#include + +#include "lyxlib.h" + +int lyx::atoi(string const & nstr) +{ + return ::atoi(nstr.c_str()); +} diff --git a/src/support/chdir.C b/src/support/chdir.C index 0ce2df4942..f80e989036 100644 --- a/src/support/chdir.C +++ b/src/support/chdir.C @@ -12,3 +12,12 @@ int lyx::chdir(char const * name) return ::_chdir2(name); #endif } + +int lyx::chdir(string const & name) +{ +#ifndef __EMX__ + return ::chdir(name.c_str()); +#else + return ::_chdir2(name.c_str()); +#endif +} diff --git a/src/support/copy.C b/src/support/copy.C index 7324d44568..4c083da791 100644 --- a/src/support/copy.C +++ b/src/support/copy.C @@ -2,20 +2,12 @@ #include -//#include - #include "support/lyxlib.h" #include "LString.h" -//#include "support/syscall.h" #include "support/filetools.h" 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()); if (!ifs) return false; 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(); if (ofs.good()) return true; return false; -#endif } diff --git a/src/support/filetools.C b/src/support/filetools.C index 287a7e5860..704de2db55 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -74,14 +74,14 @@ bool IsLyXFilename(string const & filename) string const MakeLatexName(string const & file) { string name = OnlyFilename(file); - string path = OnlyPath(file); + string const path = OnlyPath(file); for (string::size_type i = 0; i < name.length(); ++i) { name[i] &= 0x7f; // set 8th bit to 0 }; // ok so we scan through the string twice, but who cares. - string keep("abcdefghijklmnopqrstuvwxyz" + string const keep("abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "@!\"'()*+,-./0123456789:;<=>?[]`|"); @@ -167,7 +167,7 @@ int IsFileWriteable (string const & path) // -1: error- couldn't find out int IsDirWriteable (string const & path) { - string tmpfl(TmpFileName(path)); + string const tmpfl(TmpFileName(path)); if (tmpfl.empty()) { 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' // Expand Environmentvariables in 'name' - string tmpname = ReplaceEnvironmentPath(name); + string const tmpname = ReplaceEnvironmentPath(name); string fullname = MakeAbsPath(tmpname, path); // search first without extension, then with it. @@ -272,13 +272,13 @@ string const i18nLibFileSearch(string const & dir, string const & name, string const & ext) { - string lang = token(string(GetEnv("LANG")), '_', 0); + string const lang = token(string(GetEnv("LANG")), '_', 0); if (lang.empty() || lang == "C") return LibFileSearch(dir, name, ext); else { - string tmp = LibFileSearch(dir, lang + '_' + name, - ext); + string const tmp = LibFileSearch(dir, lang + '_' + name, + ext); if (!tmp.empty()) return tmp; else @@ -290,8 +290,8 @@ i18nLibFileSearch(string const & dir, string const & name, string const GetEnv(string const & envname) { // f.ex. what about error checking? - char const * const ch = getenv(envname.c_str()); - string envstr = !ch ? "" : ch; + char const * const ch = ::getenv(envname.c_str()); + string const envstr = !ch ? "" : ch; return envstr; } @@ -299,9 +299,9 @@ string const GetEnv(string const & envname) string const GetEnvPath(string const & name) { #ifndef __EMX__ - string pathlist = subst(GetEnv(name), ':', ';'); + string const pathlist = subst(GetEnv(name), ':', ';'); #else - string pathlist = subst(GetEnv(name), '\\', '/'); + string const pathlist = subst(GetEnv(name), '\\', '/'); #endif return strip(pathlist, ';'); } @@ -324,7 +324,7 @@ bool PutEnv(string const & envstr) char * leaker = new char[envstr.length() + 1]; envstr.copy(leaker, envstr.length()); 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 // is very dangerous. OTOH if it does take a copy this is the @@ -337,11 +337,11 @@ bool PutEnv(string const & envstr) #else #ifdef HAVE_SETENV string varname; - string str = envstr.split(varname,'='); - int retval = setenv(varname.c_str(), str.c_str(), true); + string const str = envstr.split(varname,'='); + int const retval = ::setenv(varname.c_str(), str.c_str(), true); #else // No environment setting function. Can this happen? - int retval = 1; //return an error condition. + int const retval = 1; //return an error condition. #endif #endif return retval == 0; @@ -372,12 +372,12 @@ int DeleteAllFilesInDir (string const & path) // if (filename == "." || filename == "..") // continue; // string unlinkpath(AddName(path, filename)); - // if (remove(unlinkpath.c_str())) + // if (lyx::unlink(unlinkpath)) // WriteFSAlert(_("Error! Could not remove file:"), // unlinkpath); // } // return 0; - DIR * dir = opendir(path.c_str()); + DIR * dir = ::opendir(path.c_str()); if (!dir) { WriteFSAlert (_("Error! Cannot open directory:"), path); return -1; @@ -385,17 +385,17 @@ int DeleteAllFilesInDir (string const & path) struct dirent * de; int return_value = 0; while ((de = readdir(dir))) { - string temp = de->d_name; + string const temp = de->d_name; if (temp == "." || temp == "..") continue; - string unlinkpath = AddName (path, temp); + string const unlinkpath = AddName (path, temp); lyxerr.debug() << "Deleting file: " << unlinkpath << endl; bool deleted = true; if (FileInfo(unlinkpath).isDir()) deleted = (DeleteAllFilesInDir(unlinkpath) == 0); - deleted &= (remove(unlinkpath.c_str()) == 0); + deleted &= (lyx::unlink(unlinkpath) == 0); if (!deleted) { WriteFSAlert (_("Error! Could not remove file:"), unlinkpath); @@ -408,11 +408,11 @@ int DeleteAllFilesInDir (string const & path) 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:"), tempdir); return string(); @@ -422,13 +422,13 @@ string const CreateTmpDir (string const & tempdir, string const & mask) static -int DestroyTmpDir (string const & tmpdir, bool Allfiles) +int DestroyTmpDir(string const & tmpdir, bool Allfiles) { #ifdef __EMX__ Path p(user_lyxdir); #endif if (Allfiles && DeleteAllFilesInDir(tmpdir)) return -1; - if (rmdir(tmpdir.c_str())) { + if (lyx::rmdir(tmpdir)) { WriteFSAlert(_("Error! Couldn't delete temporary directory:"), tmpdir); return -1; @@ -437,26 +437,26 @@ int DestroyTmpDir (string const & tmpdir, bool Allfiles) } -string const CreateBufferTmpDir (string const & pathfor) +string const CreateBufferTmpDir(string const & pathfor) { return CreateTmpDir(pathfor, "lyx_bufrtmp"); } -int DestroyBufferTmpDir (string const & tmpdir) +int DestroyBufferTmpDir(string const & tmpdir) { return DestroyTmpDir(tmpdir, true); } -string const CreateLyXTmpDir (string const & deflt) +string const CreateLyXTmpDir(string const & deflt) { if ((!deflt.empty()) && (deflt != "/tmp")) { - if (lyx::mkdir(deflt.c_str(), 0777)) { + if (lyx::mkdir(deflt, 0777)) { #ifdef __EMX__ Path p(user_lyxdir); #endif - string t(CreateTmpDir (deflt.c_str(), "lyx_tmp")); + string const t(CreateTmpDir(deflt, "lyx_tmp")); return t; } else return deflt; @@ -464,7 +464,7 @@ string const CreateLyXTmpDir (string const & deflt) #ifdef __EMX__ Path p(user_lyxdir); #endif - string t(CreateTmpDir ("/tmp", "lyx_tmp")); + string const t(CreateTmpDir("/tmp", "lyx_tmp")); return t; } } @@ -487,7 +487,7 @@ bool createDirectory(string const & path, int permission) return false; } - if (lyx::mkdir(temp.c_str(), permission)) { + if (lyx::mkdir(temp, permission)) { WriteFSAlert (_("Error! Couldn't create directory:"), temp); return false; } @@ -503,7 +503,7 @@ string const GetCWD () char * tbuf = new char[n]; // Safe. Hopefully all getcwds behave this way! - while (((err = lyx::getcwd (tbuf, n)) == 0) && (errno == ERANGE)) { + while (((err = lyx::getcwd(tbuf, n)) == 0) && (errno == ERANGE)) { // Buffer too small, double the buffersize and try again delete[] tbuf; n = 2 * n; @@ -611,7 +611,7 @@ string const MakeAbsPath(string const & RelPath, string const & BasePath) string const AddName(string const & path, string const & fname) { // Get basename - string basename(OnlyFilename(fname)); + string const basename(OnlyFilename(fname)); string buf; @@ -661,7 +661,7 @@ string const ExpandPath(string const & path) return RTemp; string Temp; - string copy(RTemp); + string const copy(RTemp); // Split by next / 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 buf; - string path2 = CleanupPath(path_2); + string const path2 = CleanupPath(path_2); if (!path.empty() && path != "." && path != "./") { buf = CleanupPath(path); @@ -932,7 +932,7 @@ string const AddPath(string const & path, string const & path_2) string const 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('.'); if (last_dot < last_slash && last_slash != 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 .) string const GetExtension(string const & name) { - string::size_type last_slash = name.rfind('/'); - string::size_type last_dot = name.rfind('.'); + string::size_type const last_slash = name.rfind('/'); + string::size_type const last_dot = name.rfind('.'); if (last_dot != string::npos && (last_slash == string::npos || last_dot > last_slash)) return name.substr(last_dot + 1, @@ -1017,7 +1017,8 @@ bool LyXReadLink(string const & File, string & Link) { char LinkBuffer[512]; // 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) return false; LinkBuffer[nRead] = 0; @@ -1035,7 +1036,7 @@ cmdret const do_popen(string const & cmd) // of course the best would be to have a // pstream (process stream), with the // variants ipstream, opstream - FILE * inf = popen(cmd.c_str(), "r"); + FILE * inf = ::popen(cmd.c_str(), "r"); string ret; int c = fgetc(inf); while (c != EOF) { @@ -1103,7 +1104,7 @@ void removeAutosaveFile(string const & filename) a += '#'; FileInfo fileinfo(a); if (fileinfo.exist()) { - if (::remove(a.c_str()) != 0) { + if (lyx::unlink(a) != 0) { WriteFSAlert(_("Could not delete auto-save file!"), a); } } diff --git a/src/support/lstrings.C b/src/support/lstrings.C index 3d040d78f9..fae7df7bfa 100644 --- a/src/support/lstrings.C +++ b/src/support/lstrings.C @@ -32,7 +32,8 @@ using std::transform; using std::tolower; using std::toupper; #endif - + + int compare_no_case(string const & s, string const & s2) { // ANSI C @@ -84,7 +85,7 @@ bool isStrInt(string const & str) if (str.empty()) return false; // Remove leading and trailing white space chars. - string tmpstr = frontStrip(strip(str, ' '), ' '); + string const tmpstr = frontStrip(strip(str, ' '), ' '); if (tmpstr.empty()) return false; string::const_iterator cit = tmpstr.begin(); @@ -101,9 +102,9 @@ int strToInt(string const & str) { if (isStrInt(str)) { // Remove leading and trailing white space chars. - string tmpstr = frontStrip(strip(str, ' '), ' '); + string const tmpstr = frontStrip(strip(str, ' '), ' '); // Do the conversion proper. - return atoi(tmpstr.c_str()); + return lyx::atoi(tmpstr); } else { return 0; } @@ -115,7 +116,7 @@ bool isStrDbl(string const & str) if (str.empty()) return false; // Remove leading and trailing white space chars. - string tmpstr = frontStrip(strip(str, ' '), ' '); + string const tmpstr = frontStrip(strip(str, ' '), ' '); if (tmpstr.empty()) return false; // if (1 < tmpstr.count('.')) return false; @@ -144,9 +145,9 @@ double strToDbl(string const & str) { if (isStrDbl(str)) { // Remove leading and trailing white space chars. - string tmpstr = frontStrip(strip(str, ' '), ' '); + string const tmpstr = frontStrip(strip(str, ' '), ' '); // Do the conversion proper. - return atof(tmpstr.c_str()); + return ::atof(tmpstr.c_str()); } else { return 0.0; } @@ -203,8 +204,10 @@ bool prefixIs(string const & a, char const * pre) { Assert(pre); - unsigned int l = strlen(pre); - if (l > a.length() || a.empty()) + unsigned int const l = strlen(pre); + string::size_type const alen = a.length(); + + if (l > alen || a.empty()) return false; else { #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) { 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) { Assert(a); - - if (!*a || b.empty()) return false; - return strstr(a, b.c_str()) != 0; + string const at(a); + return contains(at, b); } bool contains(string const & a, char const * b) { Assert(b); - - if (a.empty()) - return false; - return a.find(b) != string::npos; + string const bt(b); + return contains(a, bt); } @@ -281,9 +316,9 @@ bool contains(string const & a, string const & b) bool contains(char const * a, char const * b) { Assert(a && b); - - if (!*a || !*b) return false; - return strstr(a, b) != 0; + string const at(a); + string const bt(b); + 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) { if (a.empty()) return a; diff --git a/src/support/lstrings.h b/src/support/lstrings.h index 29cf5614b2..d718b57243 100644 --- a/src/support/lstrings.h +++ b/src/support/lstrings.h @@ -80,8 +80,9 @@ string const tostr(T const & t) /// +template<> inline -string const tostr(bool b) +string const tostr(bool const & b) { return (b ? "true" : "false"); } @@ -89,12 +90,18 @@ string const tostr(bool b) /// Does the string start with this prefix? bool prefixIs(string const &, char const *); +/// Does the string start with this prefix? +bool prefixIs(string const &, string const &); + /// Does the string end with this char? bool suffixIs(string const &, char); /// Does the string end with this suffix? bool suffixIs(string const &, char const *); +/// Does the string end with this suffix? +bool suffixIs(string const &, string const &); + /// bool contains(char const * a, string const & b); @@ -153,6 +160,10 @@ string const subst(string const & a, char oldchar, char newchar); string const subst(string const & a, char const * oldstr, string const & newstr); +/// substitutes all instances ofr oldstr with newstr +string const subst(string const & a, + string const & oldstr, string const & newstr); + /** Strips characters off the end of a string. #"abccc".strip('c') = "ab".# */ diff --git a/src/support/lyxlib.h b/src/support/lyxlib.h index e7fd1c55a7..89e1b3c8d5 100644 --- a/src/support/lyxlib.h +++ b/src/support/lyxlib.h @@ -26,12 +26,18 @@ namespace lyx { char * getcwd(char * buffer, size_t size); /// int chdir(char const * name); + /// + int chdir(string const & name); /// Returns false it it fails bool rename(char const * from, char const * to); + /// Returns false if it fails + bool rename(string const & from, string const & to); /// Returns false it it fails bool copy(string const & from, string const & to); /// generates a checksum unsigned long sum(char const * file); + /// generates a checksum + unsigned long sum(string const & file); /// returns a date string (not used currently) char * date(); /// returns the name of the user (not used currently) @@ -40,10 +46,16 @@ namespace lyx { int kill(long int pid, int sig); /// void abort(); - /// - int mkdir(char const * pathname, unsigned long int mode); + /// + int mkdir(string const & pathname, unsigned long int mode); /// int putenv(char const * str); + /// + int unlink(string const & file); + /// + int rmdir(string const & file); + /// + int atoi(string const & nstr); } #else /// @@ -52,12 +64,18 @@ struct lyx { static char * getcwd(char * buffer, size_t size); /// static int chdir(char const * name); + /// + static int chdir(string const & name); /// Returns false it it fails static bool rename(char const * from, char const * to); + /// Returns false if it fails + static bool rename(string const & from, string const & to); /// Returns false it it fails static bool copy(string const & from, string const & to); /// generates a checksum static unsigned long sum(char const * file); + /// generates a checksum + static unsigned long sum(string const & file); /// returns a date string (not used currently) static char * date(); /// returns the name of the user (not used currently) @@ -67,9 +85,15 @@ struct lyx { /// static void abort(); /// - static int mkdir(char const * pathname, unsigned long int mode); + static int mkdir(string const & pathname, unsigned long int mode); /// static int putenv(char const * str); + /// + int unlink(string const & file); + /// + int rmdir(string const & file); + /// + int atoi(string const & nstr); }; #endif // CXX_WORKING_NAMESPACES #endif diff --git a/src/support/lyxstring.C b/src/support/lyxstring.C index ce010fad4c..4e7438d69f 100644 --- a/src/support/lyxstring.C +++ b/src/support/lyxstring.C @@ -414,7 +414,7 @@ lyxstring::lyxstring(value_type const * s, size_type n) { Assert(s && n < npos); // STD! static Srep empty_rep(0, ""); - if (*s && n) { // s is not empty string and n > 0 + if (n) { // n > 0 rep = new Srep(n, s); } else { ++empty_rep.ref; @@ -549,7 +549,7 @@ void lyxstring::reserve(size_type res_arg) // Assignment //////////////// -lyxstring & lyxstring::operator= (lyxstring const & x) +lyxstring & lyxstring::operator=(lyxstring const & x) { TestlyxstringInvariant(this); @@ -557,7 +557,7 @@ lyxstring & lyxstring::operator= (lyxstring const & x) } -lyxstring & lyxstring::operator= (value_type const * s) +lyxstring & lyxstring::operator=(value_type const * s) { Assert(s); // OURS! TestlyxstringInvariant(this); @@ -605,14 +605,13 @@ lyxstring & lyxstring::assign(lyxstring const & x, size_type pos, size_type n) lyxstring & lyxstring::assign(value_type const * s, size_type n) { - Assert(s); // OURS! + Assert(s && n < npos); // STD! TestlyxstringInvariant(this); - n = min(strlen(s), n); if (rep->ref == 1) // recycle rep rep->assign(n, s); else { - rep->ref--; + --rep->ref; rep = new Srep(n, s); } return *this; @@ -753,7 +752,7 @@ lyxstring & lyxstring::append(value_type const * p, size_type n) if (!*p || !n) return *this; rep = rep->get_own_copy(); - rep->append(min(n, strlen(p)), p); + rep->append(n, p); return *this; } @@ -761,12 +760,7 @@ lyxstring & lyxstring::append(value_type const * p, size_type n) lyxstring & lyxstring::append(value_type const * p) { Assert(p); // OURS! - TestlyxstringInvariant(this); - - if (!*p) return *this; - rep = rep->get_own_copy(); - rep->append(strlen(p), p); - return *this; + return append(p, strlen(p)); } @@ -792,7 +786,7 @@ lyxstring & lyxstring::append(iterator first, iterator last) return *this; } -// insert value_typeacters before (*this)[pos] +// insert characters before (*this)[pos] lyxstring & lyxstring::insert(size_type pos, lyxstring const & x) { @@ -822,7 +816,7 @@ lyxstring & lyxstring::insert(size_type pos, value_type const * p, size_type n) if (*p && n) { // insert nothing and you change nothing rep = rep->get_own_copy(); - rep->insert(pos, p, min(n, strlen(p))); + rep->insert(pos, p, n); } return *this; } @@ -831,14 +825,7 @@ lyxstring & lyxstring::insert(size_type pos, value_type const * p, size_type n) lyxstring & lyxstring::insert(size_type pos, value_type const * p) { Assert(p); // OURS! - TestlyxstringInvariant(this); - - if (*p) { - // insert nothing and you change nothing - rep = rep->get_own_copy(); - rep->insert(pos, p, strlen(p)); - } - return *this; + return insert(pos, p, strlen(p)); } diff --git a/src/support/lyxsum.C b/src/support/lyxsum.C index e018073f2b..691ff2e71d 100644 --- a/src/support/lyxsum.C +++ b/src/support/lyxsum.C @@ -118,3 +118,9 @@ unsigned long lyx::sum(char const * file) string w = ostr.str().c_str(); return do_crc(w.begin(), w.end()); } + + +unsigned long lyx::sum(string const & file) +{ + return lyx::sum(file.c_str()); +} diff --git a/src/support/mkdir.C b/src/support/mkdir.C index 580fcc8f94..e3a5102ecb 100644 --- a/src/support/mkdir.C +++ b/src/support/mkdir.C @@ -5,18 +5,11 @@ #include #include -#ifdef CXX_WORKING_NAMESPACES -namespace lyx { - int mkdir(char const * pathname, unsigned long int mode) - { - return ::mkdir(pathname, mode); - } -} -#else +#include "LString.h" + #include "lyxlib.h" -int lyx::mkdir(char const * pathname, unsigned long int mode) +int lyx::mkdir(string const & pathname, unsigned long int mode) { - return ::mkdir(pathname, mode); + return ::mkdir(pathname.c_str(), mode); } -#endif diff --git a/src/support/path.C b/src/support/path.C index 7752dccb11..fba75b46be 100644 --- a/src/support/path.C +++ b/src/support/path.C @@ -17,7 +17,7 @@ int Path::pop() // pushedDir_); return 0; } - if (lyx::chdir(pushedDir_.c_str())) { + if (lyx::chdir(pushedDir_)) { // should throw an exception // throw DirChangeError(); // The use of WriteFSAlert makes this impossible diff --git a/src/support/path.h b/src/support/path.h index d2480670c3..893b4bdc71 100644 --- a/src/support/path.h +++ b/src/support/path.h @@ -21,7 +21,7 @@ public: { if (!path.empty()) { pushedDir_ = GetCWD(); - if (pushedDir_.empty() || lyx::chdir(path.c_str())) { + if (pushedDir_.empty() || lyx::chdir(path)) { // should throw an exception // throw DirChangeError(); // The use of WriteFSAlert makes this diff --git a/src/support/rename.C b/src/support/rename.C index 3f93246791..7a04be730a 100644 --- a/src/support/rename.C +++ b/src/support/rename.C @@ -1,6 +1,6 @@ #include -#include +#include #include "support/lyxlib.h" @@ -8,3 +8,8 @@ bool lyx::rename(char const * from, char const * to) { return ::rename(from, to) != -1; } + +bool lyx::rename(string const & from, string const & to) +{ + return ::rename(from.c_str(), to.c_str()) != -1; +} diff --git a/src/support/rmdir.C b/src/support/rmdir.C new file mode 100644 index 0000000000..5b45cfba9b --- /dev/null +++ b/src/support/rmdir.C @@ -0,0 +1,10 @@ +#include + +#include + +#include "lyxlib.h" + +int lyx::rmdir(string const & dir) +{ + return ::rmdir(dir.c_str()); +} diff --git a/src/support/syscall.C b/src/support/syscall.C index 3630103758..26bd1a16fd 100644 --- a/src/support/syscall.C +++ b/src/support/syscall.C @@ -51,7 +51,7 @@ int Systemcalls::startscript() { switch (start) { case System: case SystemDontWait: - retval = system(command.c_str()); + retval = ::system(command.c_str()); callback(); break; case Wait: diff --git a/src/support/unlink.C b/src/support/unlink.C new file mode 100644 index 0000000000..ef3b520332 --- /dev/null +++ b/src/support/unlink.C @@ -0,0 +1,10 @@ +#include + +#include + +#include "lyxlib.h" + +int lyx::unlink(string const & pathname) +{ + return ::unlink(pathname.c_str()); +} diff --git a/src/tabular.C b/src/tabular.C index c68c5df648..275cfb132b 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -160,28 +160,29 @@ void LyXTabular::Init(int rows_arg, int columns_arg) rows_ = rows_arg; columns_ = columns_arg; - row_info = vector(rows_, rowstruct()); - column_info = vector(columns_, columnstruct()); - cell_info = vector > - (rows_, vector(columns_, cellstruct())); + row_info = row_vector(rows_, rowstruct()); + column_info = column_vector(columns_, columnstruct()); + cell_info = cell_vvector(rows_, cell_vector(columns_, cellstruct())); // Jürgen, use iterators. int cellno = 0; - int i = 0; - for (; i < rows_; ++i) { + for (int i = 0; i < rows_; ++i) { for (int j = 0; j < columns_; ++j) { cell_info[i][j].inset.setOwner(owner_); cell_info[i][j].inset.SetDrawFrame(0, InsetText::LOCKED); cell_info[i][j].cellno = cellno++; } } - row_info[i - 1].bottom_line = true; - row_info[0].bottom_line = true; + //row_info[i - 1].bottom_line = true; + //row_info[0].bottom_line = true; + row_info.back().bottom_line = true; + row_info.front().bottom_line = true; - for (i = 0; i < columns_; ++i) { + for (int i = 0; i < columns_; ++i) { calculate_width_of_column(i); } - column_info[columns_ - 1].right_line = true; + //column_info[columns_ - 1].right_line = true; + column_info.back().right_line = true; calculate_width_of_tabular(); @@ -197,7 +198,7 @@ void LyXTabular::Init(int rows_arg, int columns_arg) } -void LyXTabular::AppendRow(int cell ) +void LyXTabular::AppendRow(int cell) { ++rows_; @@ -235,8 +236,11 @@ void LyXTabular::AppendRow(int cell ) void LyXTabular::DeleteRow(int row) { - if (!(rows_ - 1)) - return; + // Why make it so hard? (Lgb) + //if (!(rows_ - 1)) + //return; + if (rows_ == 1) return; // Not allowed to delete last row + row_info.erase(row_info.begin() + row); //&row_info[row]); cell_info.erase(cell_info.begin() + row); //&cell_info[row]); --rows_; @@ -281,8 +285,11 @@ void LyXTabular::AppendColumn(int cell) void LyXTabular::DeleteColumn(int column) { - if (!(columns_ - 1)) - return; + // Similar to DeleteRow + //if (!(columns_ - 1)) + //return; + if (columns_ == 1) return; // Not allowed to delete last column + column_info.erase(column_info.begin() + column); for (int i = 0; i < rows_; ++i) { cell_info[i].erase(cell_info[i].begin() + column); @@ -367,7 +374,7 @@ int LyXTabular::GetNumberOfCells() const int LyXTabular::NumberOfCellsInRow(int cell) const { - int row = row_of_cell(cell); + int const row = row_of_cell(cell); int result = 0; for (int i = 0; i < columns_; ++i) { if (cell_info[row][i].multicolumn != LyXTabular::CELL_PART_OF_MULTICOLUMN) @@ -380,7 +387,7 @@ int LyXTabular::NumberOfCellsInRow(int cell) const /* returns 1 if there is a topline, returns 0 if not */ bool LyXTabular::TopLine(int cell, bool onlycolumn) const { - int row = row_of_cell(cell); + int const row = row_of_cell(cell); if (!onlycolumn && IsMultiColumn(cell)) return cellinfo_of_cell(cell)->top_line; @@ -390,7 +397,9 @@ bool LyXTabular::TopLine(int cell, bool onlycolumn) const bool LyXTabular::BottomLine(int cell, bool onlycolumn) const { - //no bottom line underneath non-existent cells if you please + // no bottom line underneath non-existent cells if you please + // Isn't that a programming error? Is so this should + // be an Assert instead. (Lgb) if(cell >= numberofcells) return false; @@ -461,9 +470,10 @@ bool LyXTabular::IsLastRow(int cell) const int LyXTabular::GetAdditionalHeight(int cell) const { - int row = row_of_cell(cell); + int const row = row_of_cell(cell); if (!row) return 0; - + +#warning Jürgen, should the types change? (Lgb) int top = 1; // bool top = true; ?? int bottom = 1; // bool bottom = true; ?? @@ -495,7 +505,7 @@ int LyXTabular::GetAdditionalWidth(int cell) const { // internally already set in SetWidthOfCell // used to get it back in text.C - int col = right_column_of_cell(cell); + int const col = right_column_of_cell(cell); if (col < columns_ - 1 && column_info[col].right_line && column_info[col+1].left_line) return WIDTH_OF_LINE; @@ -541,9 +551,9 @@ bool LyXTabular::SetWidthOfMulticolCell(int cell, int new_width) } // set the width to MAX_WIDTH until width > 0 int width = (new_width + 2 * WIDTH_OF_LINE); - for (i = column1; (i < column2) && (width>column_info[i].width_of_column); - ++i) - { + for (i = column1; + i < column2 && width > column_info[i].width_of_column; + ++i) { cell_info[row][i].width_of_cell = column_info[i].width_of_column; width -= column_info[i].width_of_column; } @@ -599,7 +609,7 @@ bool LyXTabular::SetWidthOfCell(int cell, int new_width) for(i = 0; (i < numberofcells) && !IsMultiColumn(i); ++i) ; if (i < numberofcells) - recalculateMulticolCells(i, GetWidthOfCell(i)-(2*WIDTH_OF_LINE)); + recalculateMulticolCells(i, GetWidthOfCell(i)-(2 * WIDTH_OF_LINE)); for(i = 0; i < columns_; ++i) calculate_width_of_column(i); calculate_width_of_tabular(); @@ -611,6 +621,7 @@ bool LyXTabular::SetWidthOfCell(int cell, int new_width) bool LyXTabular::SetAlignment(int cell, char align, bool onlycolumn) { +#warning Please fix align type. (Lgb) if (!IsMultiColumn(cell) || onlycolumn) column_info[column_of_cell(cell)].alignment = align; if (!onlycolumn) @@ -621,6 +632,7 @@ bool LyXTabular::SetAlignment(int cell, char align, bool onlycolumn) bool LyXTabular::SetVAlignment(int cell, char align, bool onlycolumn) { +#warning Please fix align type. (Lgb) if (!IsMultiColumn(cell) || onlycolumn) column_info[column_of_cell(cell)].valignment = align; if (!onlycolumn) @@ -661,6 +673,7 @@ bool LyXTabular::SetMColumnPWidth(int cell, string const & width) bool LyXTabular::SetAlignSpecial(int cell, string const & special, int what) { +#warning Fix the "what" type. (Lgb) if (what == SET_SPECIAL_MULTI) cellinfo_of_cell(cell)->align_special = special; else @@ -723,6 +736,7 @@ bool LyXTabular::SetRightLine(int cell, bool line, bool onlycolumn) char LyXTabular::GetAlignment(int cell, bool onlycolumn) const { +#warning Fix return type. (Lgb) if (!onlycolumn && IsMultiColumn(cell)) return cellinfo_of_cell(cell)->alignment; else @@ -732,6 +746,7 @@ char LyXTabular::GetAlignment(int cell, bool onlycolumn) const char LyXTabular::GetVAlignment(int cell, bool onlycolumn) const { +#warning Fix return type. (Lgb) if (!onlycolumn && IsMultiColumn(cell)) return cellinfo_of_cell(cell)->valignment; else @@ -781,6 +796,7 @@ int LyXTabular::GetWidthOfCell(int cell) const return result; } + int LyXTabular::GetBeginningOfTextInCell(int cell) const { int x = 0; @@ -805,7 +821,7 @@ int LyXTabular::GetBeginningOfTextInCell(int cell) const bool LyXTabular::IsFirstCellInRow(int cell) const { - return (column_of_cell(cell) == 0); + return column_of_cell(cell) == 0; } @@ -905,52 +921,52 @@ int LyXTabular::right_column_of_cell(int cell) const void LyXTabular::Write(Buffer const * buf, ostream & os) const { // header line - os << "" << endl; + os << "\n"; // global longtable options - os << "" << endl << endl; + os << "\n\n"; for (int i = 0; i < rows_; ++i) { - os << "" << endl; + os << "\n"; for (int j = 0; j < columns_; ++j) { if (!i) { - os << "" << endl; + os << ""; } else { - os << "" << endl; + os << "\n"; } - os << "" << endl; + os << "\n"; os << "\\begin_inset "; cell_info[i][j].inset.Write(buf, os); - os << "\n\\end_inset " << endl; - os << "" << endl; - os << "" << endl; + os << "\n\\end_inset \n" + << "\n" + << ""; } - os << "" << endl; + os << "\n"; } - os << "" << endl; + os << "\n"; } @@ -979,13 +995,13 @@ bool getTokenValue(string const str, const char * token, string & ret) static bool getTokenValue(string const str, const char * token, int & num) { - string ret; int pos = str.find(token); char ch = str[pos+strlen(token)]; if ((pos < 0) || (ch != '=')) return false; - ret.erase(); + string ret; + //ret.erase(); // why? (Lgb) pos += strlen(token)+1; ch = str[pos]; if ((ch != '"') && (ch != '\'')) { // only read till next space @@ -1005,13 +1021,13 @@ bool getTokenValue(string const str, const char * token, int & num) static bool getTokenValue(string const str, const char * token, bool & flag) { - string ret; int pos = str.find(token); char ch = str[pos+strlen(token)]; if ((pos < 0) || (ch != '=')) return false; - ret.erase(); + string ret; + //ret.erase(); // Why? (Lgb) pos += strlen(token)+1; ch = str[pos]; if ((ch != '"') && (ch != '\'')) { // only read till next space @@ -1163,7 +1179,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl) istream & is = lex.getStream(); string s(fl); if (s.length() > 8) - version = atoi(s.c_str() + 8); + version = lyx::atoi(s.substr(8, string::npos)); else version = 1; @@ -1261,19 +1277,19 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl) LyXParagraph::footnote_flag footnoteflag = LyXParagraph::NO_FOOTNOTE; LyXParagraph::footnote_kind footnotekind = LyXParagraph::FOOTNOTE; #endif - string token, tmptok; + string tmptok; int pos = 0; char depth = 0; LyXFont font(LyXFont::ALL_SANE); while (lex.IsOK()) { lex.nextToken(); - token = lex.GetString(); + string const token = lex.GetString(); if (token.empty()) continue; - if ((token == "\\layout") || (token == "\\end_float") || - (token == "\\end_deeper")) - { + if (token == "\\layout" + || token == "\\end_float" + || token == "\\end_deeper") { lex.pushToken(token); break; } @@ -1343,7 +1359,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl) string const LyXTabular::GetDocBookAlign(int cell, bool isColumn) const { - int i = isColumn ? cell : column_of_cell(cell); + int const i = isColumn ? cell : column_of_cell(cell); if (!isColumn && IsMultiColumn(cell)) { if (!cellinfo_of_cell(cell)->align_special.empty()) { @@ -1388,7 +1404,6 @@ string const LyXTabular::GetDocBookAlign(int cell, bool isColumn) const int LyXTabular::DocBookEndOfCell(ostream & os, int cell, int & depth) const { int ret = 0; - int nvcell; if (IsLastCell(cell)) { os << newlineAndDepth(--depth) << "" @@ -1404,7 +1419,6 @@ int LyXTabular::DocBookEndOfCell(ostream & os, int cell, int & depth) const << newlineAndDepth(--depth); ret += 4; } else { - nvcell = cell + 1; if (cell < 0) { // preamble if (is_long_tabular) @@ -1517,7 +1531,7 @@ LyXTabular::cellstruct * LyXTabular::cellinfo_of_cell(int cell) const int const column = column_of_cell(cell); return &cell_info[row][column]; } - + void LyXTabular::SetMultiColumn(int cell, int number) { @@ -1573,6 +1587,7 @@ int LyXTabular::UnsetMultiColumn(int cell) void LyXTabular::SetLongTabular(int what) { +#warning Should what be bool? (Lgb) is_long_tabular = what; } @@ -1688,6 +1703,7 @@ void LyXTabular::SetUsebox(int cell, BoxType type) int LyXTabular::GetUsebox(int cell) const { +#warning should the return type change? (Lgb) if (column_info[column_of_cell(cell)].p_width.empty() && !(IsMultiColumn(cell) && !cellinfo_of_cell(cell)->p_width.empty())) return BOX_NONE; @@ -2009,7 +2025,6 @@ int LyXTabular::Latex(Buffer const * buf, ostream & os, bool fragile, bool fp) const { int ret = 0; - int i,j; int cell = 0; //+--------------------------------------------------------------------- @@ -2024,7 +2039,7 @@ int LyXTabular::Latex(Buffer const * buf, os << "\\begin{longtable}{"; else os << "\\begin{tabular}{"; - for (i = 0; i < columns_; ++i) { + for (int i = 0; i < columns_; ++i) { if (column_info[i].left_line) os << '|'; if (!column_info[i].align_special.empty()) { @@ -2068,7 +2083,7 @@ int LyXTabular::Latex(Buffer const * buf, //+--------------------------------------------------------------------- int bret; - for(i=0; i < rows_; ++i) { + for(int i = 0; i < rows_; ++i) { ret += TeXTopHLine(os, i); bret = ret; if (IsLongTabular()) { @@ -2094,7 +2109,7 @@ int LyXTabular::Latex(Buffer const * buf, ret += TeXBottomHLine(os, i-1); ret += TeXTopHLine(os, i); } - for(j=0; j < columns_; ++j) { + for(int j = 0; j < columns_; ++j) { if (IsPartOfMultiColumn(i,j)) continue; ret += TeXCellPreamble(os, cell); @@ -2110,19 +2125,19 @@ int LyXTabular::Latex(Buffer const * buf, ret += TeXBottomHLine(os, i); bret = ret; if (IsLongTabular()) { - if ((endhead > 0) && (i == (endhead-1))) { + if ((endhead > 0) && (i == (endhead - 1))) { os << "\\endhead\n"; ++ret; } - if ((endfirsthead > 0) && (i == (endfirsthead-1))) { + if ((endfirsthead > 0) && (i == (endfirsthead - 1))) { os << "\\endfirsthead\n"; ++ret; } - if ((endfoot > 0) && (i == (endfoot-1))) { + if ((endfoot > 0) && (i == (endfoot - 1))) { os << "\\endfoot\n"; ++ret; } - if ((endlastfoot > 0) && (i == (endlastfoot-1))) { + if ((endlastfoot > 0) && (i == (endlastfoot - 1))) { os << "\\endlastfoot\n"; ++ret; } diff --git a/src/text.C b/src/text.C index cf12ba24af..5f3e19075d 100644 --- a/src/text.C +++ b/src/text.C @@ -13,10 +13,6 @@ #include #include -//#ifdef __GNUG__ -//#pragma implementation "table.h" -//#endif - #include "layout.h" #include "lyxparagraph.h" #include "lyxtext.h" @@ -44,6 +40,7 @@ using std::endl; using std::pair; static const int LYX_PAPER_MARGIN = 20; + extern int bibitemMaxWidth(BufferView *, LyXFont const &); @@ -73,16 +70,17 @@ unsigned char LyXText::TransformChar(unsigned char c, LyXParagraph * par, break; } - if (Encoding::is_arabic(next_char)) + if (Encoding::is_arabic(next_char)) { if (Encoding::is_arabic(prev_char)) return Encoding::TransformChar(c, Encoding::FORM_MEDIAL); else return Encoding::TransformChar(c, Encoding::FORM_INITIAL); - else + } else { if (Encoding::is_arabic(prev_char)) return Encoding::TransformChar(c, Encoding::FORM_FINAL); else return Encoding::TransformChar(c, Encoding::FORM_ISOLATED); + } } // This is the comments that some of the warnings below refers to. @@ -113,7 +111,7 @@ unsigned char LyXText::TransformChar(unsigned char c, LyXParagraph * par, int LyXText::SingleWidth(BufferView * bview, LyXParagraph * par, LyXParagraph::size_type pos) const { - char c = par->GetChar(pos); + char const c = par->GetChar(pos); return SingleWidth(bview, par, pos, c); } @@ -340,7 +338,7 @@ bool LyXText::IsBoundary(Buffer const * buf, LyXParagraph * par, if (!bidi_InRange(pos - 1)) return false; - bool rtl = bidi_level(pos - 1) % 2; + bool const rtl = bidi_level(pos - 1) % 2; bool rtl2 = rtl; if (pos == par->Last()) rtl2 = par->isRightToLeftPar(buf->params); @@ -357,7 +355,7 @@ bool LyXText::IsBoundary(Buffer const * buf, LyXParagraph * par, if (!lyxrc.rtl_support) return false; // This is just for speedup - bool rtl = font.isVisibleRightToLeft(); + bool const rtl = font.isVisibleRightToLeft(); bool rtl2 = rtl; if (pos == par->Last()) rtl2 = par->isRightToLeftPar(buf->params); @@ -724,7 +722,7 @@ int LyXText::LeftMargin(BufferView * bview, Row const * row) const } - LyXFont labelfont = GetFont(bview->buffer(), row->par(), -2); + LyXFont const labelfont = GetFont(bview->buffer(), row->par(), -2); switch (layout.margintype) { case MARGIN_DYNAMIC: if (!layout.leftmargin.empty()) { @@ -813,11 +811,10 @@ int LyXText::LeftMargin(BufferView * bview, Row const * row) const break; } if ((workWidth(bview) > 0) && - (row->par()->pextra_type == LyXParagraph::PEXTRA_INDENT)) - { + (row->par()->pextra_type == LyXParagraph::PEXTRA_INDENT)) { if (!row->par()->pextra_widthp.empty()) { x += workWidth(bview) * - atoi(row->par()->pextra_widthp.c_str()) / 100; + lyx::atoi(row->par()->pextra_widthp) / 100; } else if (!row->par()->pextra_width.empty()) { int xx = VSpace(row->par()->pextra_width).inPixels(bview); if (xx > workWidth(bview)) @@ -1089,7 +1086,7 @@ int LyXText::Fill(BufferView * bview, Row * row, int paper_width) const if (paper_width < 0) return 0; - int w, fill; + int w; // get the pure distance LyXParagraph::size_type last = RowLastPrintable(row); @@ -1131,7 +1128,7 @@ int LyXText::Fill(BufferView * bview, Row * row, int paper_width) const w = left_margin; } - fill = paper_width - w - RightMargin(bview->buffer(), row); + int const fill = paper_width - w - RightMargin(bview->buffer(), row); return fill; } @@ -1139,7 +1136,7 @@ int LyXText::Fill(BufferView * bview, Row * row, int paper_width) const // returns the minimum space a manual label needs on the screen in pixel int LyXText::LabelFill(BufferView * bview, Row const * row) const { - LyXParagraph::size_type last = BeginningOfMainBody(bview->buffer(), row->par())-1; + LyXParagraph::size_type last = BeginningOfMainBody(bview->buffer(), row->par()) - 1; // -1 because a label ends either with a space that is in the label, // or with the beginning of a footnote that is outside the label. @@ -1176,8 +1173,9 @@ int LyXText::LabelFill(BufferView * bview, Row const * row) const // on the very last column doesnt count int LyXText::NumberOfSeparators(Buffer const * buf, Row const * row) const { - int last = RowLast(row); - int p = max(row->pos(), BeginningOfMainBody(buf, row->par())); + LyXParagraph::size_type const last = RowLast(row); + LyXParagraph::size_type p = + max(row->pos(), BeginningOfMainBody(buf, row->par())); int n = 0; for (; p < last; ++p) { if (row->par()->IsSeparator(p)) { @@ -1193,8 +1191,8 @@ int LyXText::NumberOfSeparators(Buffer const * buf, Row const * row) const // ignored. This is *MUCH* more usefull than not to ignore! int LyXText::NumberOfHfills(Buffer const * buf, Row const * row) const { - int last = RowLast(row); - int first = row->pos(); + LyXParagraph::size_type const last = RowLast(row); + LyXParagraph::size_type first = row->pos(); if (first) { /* hfill *DO* count at the beginning * of paragraphs! */ while(first <= last && row->par()->IsHfill(first)) @@ -1275,7 +1273,8 @@ bool LyXText::HfillExpansion(Buffer const * buf, Row const * row_ptr, void LyXText::SetHeightOfRow(BufferView * bview, Row * row_ptr) const { /* get the maximum ascent and the maximum descent */ - int asc = 0, desc = 0, pos = 0; + int asc = 0; + int desc = 0; float layoutasc = 0; float layoutdesc = 0; float tmptop = 0; @@ -1331,7 +1330,7 @@ void LyXText::SetHeightOfRow(BufferView * bview, Row * row_ptr) const int maxwidth = 0; // Check if any insets are larger - for (pos = row_ptr->pos(); pos <= pos_end; ++pos) { + for (int pos = row_ptr->pos(); pos <= pos_end; ++pos) { if (row_ptr->par()->GetChar(pos) == LyXParagraph::META_INSET) { tmpfont = GetFont(bview->buffer(), row_ptr->par(), pos); tmpinset = row_ptr->par()->GetInset(pos); @@ -1532,7 +1531,7 @@ void LyXText::SetHeightOfRow(BufferView * bview, Row * row_ptr) const LyXParagraph * nextpar = row_ptr->par()->Next(); LyXParagraph * comparepar = row_ptr->par(); float usual = 0; - float unusual = 0; + float unusual = 0; if (comparepar->GetDepth() > nextpar->GetDepth()) { usual = (textclasslist.Style(bview->buffer()->params.textclass, comparepar->GetLayout()).bottomsep * DefaultHeight()); @@ -1591,7 +1590,7 @@ void LyXText::AppendParagraph(BufferView * bview, Row * row) const // The last character position of a paragraph is an invariant so we can // safely get it here. (Asger) - int lastposition = row->par()->Last(); + int const lastposition = row->par()->Last(); do { // Get the next breakpoint @@ -1706,8 +1705,9 @@ void LyXText::BreakAgainOneRow(BufferView * bview, Row * row) void LyXText::BreakParagraph(BufferView * bview, char keep_layout) { - LyXLayout const & layout = textclasslist.Style(bview->buffer()->params.textclass, - cursor.par()->GetLayout()); + LyXLayout const & layout = + textclasslist.Style(bview->buffer()->params.textclass, + cursor.par()->GetLayout()); // this is only allowed, if the current paragraph is not empty or caption if ((cursor.par()->Last() <= 0 @@ -1951,7 +1951,7 @@ void LyXText::InsertChar(BufferView * bview, char c) if (cursor.pos() < cursor.par()->Last() && cursor.par()->IsLineSeparator(cursor.pos())) // newline always after a blank! - CursorRightIntern(bview); + CursorRight(bview); cursor.row()->fill(-1); // to force a new break } @@ -2580,7 +2580,7 @@ void LyXText::Delete(BufferView * bview) old_cursor.par()->previous->id() : 0; // just move to the right - CursorRightIntern(bview); + CursorRight(bview); // CHECK Look at the comment here. // This check is not very good... @@ -2657,7 +2657,7 @@ void LyXText::Backspace(BufferView * bview) tmppar->pagebreak_bottom = cursor.par()->pagebreak_bottom; } - CursorLeftIntern(bview); + CursorLeft(bview); // the layout things can change the height of a row ! int tmpheight = cursor.row()->height(); diff --git a/src/text2.C b/src/text2.C index d20c3ecc1c..e9a3a85fca 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1615,6 +1615,7 @@ char loweralphaCounter(int n) } +static inline char alphaCounter(int n) { if (n < 1 || n > 26) @@ -1624,6 +1625,7 @@ char alphaCounter(int n) } +static inline char hebrewCounter(int n) { static const char hebrew[22] = { @@ -2367,11 +2369,12 @@ bool LyXText::IsStringInText(LyXParagraph * par, { if (par) { LyXParagraph::size_type i = 0; - while (pos + i < par->Last() && i < str.length()&& - str[i] == par->GetChar(pos + i)) { + while (pos + i < par->Last() + && string::size_type(i) < str.length() + && str[i] == par->GetChar(pos + i)) { ++i; } - if (str.length() == i) + if (str.length() == string::size_type(i)) return true; } return false; @@ -2942,12 +2945,6 @@ void LyXText::SetCursorFromCoordinates(BufferView * bview, LyXCursor & cur, void LyXText::CursorLeft(BufferView * bview, bool internal) const -{ - CursorLeftIntern(bview, internal); -} - - -void LyXText::CursorLeftIntern(BufferView * bview, bool internal) const { if (cursor.pos() > 0) { bool boundary = cursor.boundary(); @@ -2963,12 +2960,6 @@ void LyXText::CursorLeftIntern(BufferView * bview, bool internal) const void LyXText::CursorRight(BufferView * bview, bool internal) const -{ - CursorRightIntern(bview, internal); -} - - -void LyXText::CursorRightIntern(BufferView * bview, bool internal) const { if (!internal && cursor.boundary() && !cursor.par()->IsNewline(cursor.pos())) diff --git a/src/trans_mgr.C b/src/trans_mgr.C index e6fea7a4f3..883421062b 100644 --- a/src/trans_mgr.C +++ b/src/trans_mgr.C @@ -284,7 +284,7 @@ void TransManager::TranslateAndInsert(char c, LyXText * text) void TransManager::insertVerbatim(string const & str, LyXText * text) { - int l = str.length(); + int const l = str.length(); for (int i = 0; i < l; ++i){ if (str[i] == '\"' diff --git a/src/vspace.C b/src/vspace.C index 38d2eda026..e065ab83ce 100644 --- a/src/vspace.C +++ b/src/vspace.C @@ -420,7 +420,7 @@ VSpace::VSpace (string const & data) else if (prefixIs (input, "vfill")) kin = VFILL; else if (isValidGlueLength (input, &len)) kin = LENGTH; - else if (sscanf (input.c_str(), "%f", &value) == 1) { + else if (sscanf(input.c_str(), "%f", &value) == 1) { // This last one is for reading old .lyx files // without units in added_space_top/bottom. // Let unit default to centimeters here. -- 2.39.2