From ab45a3ae914b295478724c1d80ca8ec84789e027 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 18 Jul 2000 11:06:04 +0000 Subject: [PATCH] Removed Options->LaTeX and all related code. New Variables.[Ch] files (not sure what I will do with them). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@894 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 30 +++++++ forms/latexoptions.fd | 184 ------------------------------------------ forms/log_form.fd | 88 ++++++++++++++++++++ forms/makefile | 6 +- lib/kbd/american.kmap | 30 +++---- po/POTFILES.in | 2 +- src/LaTeXLog.C | 2 +- src/Makefile.am | 7 +- src/Variables.C | 78 ++++++++++++++++++ src/Variables.h | 41 ++++++++++ src/bufferparams.C | 1 - src/bufferparams.h | 2 - src/latexoptions.C | 62 -------------- src/latexoptions.h | 35 -------- src/log_form.C | 36 +++++++++ src/log_form.h | 22 +++++ src/lyx_cb.C | 19 ----- src/lyx_gui.C | 10 +-- src/lyx_gui_misc.C | 2 +- src/lyxvc.h | 2 +- src/menus.C | 14 ++-- src/texoptions.C | 41 ---------- src/trans.C | 2 +- src/trans_mgr.C | 3 +- 24 files changed, 330 insertions(+), 389 deletions(-) delete mode 100644 forms/latexoptions.fd create mode 100644 forms/log_form.fd create mode 100644 src/Variables.C create mode 100644 src/Variables.h delete mode 100644 src/latexoptions.C delete mode 100644 src/latexoptions.h create mode 100644 src/log_form.C create mode 100644 src/log_form.h delete mode 100644 src/texoptions.C diff --git a/ChangeLog b/ChangeLog index 061a00f32b..108fdc6d29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2000-07-17 Jean-Marc Lasgouttes + + * src/Variables.[Ch]: new files. Intended to be used for language + specific strings (like \chaptername) and filename substitution in + commands. + + * src/trans.C (AddDeadkey): replace keyword "all" with "native" in + kmap files. + * lib/kbd/american.kmap: update + + * src/trans_mgr.C (normalkey): do not test allowAccent anymore. + + * src/bufferparams.[Ch]: remove member allowAccents. + + * src/menus.C (ShowOptionsMenu): remove the LaTeX entry. + + * src/LaTeXLog.C: use the log_form.h header. + * src/lyx_gui.C: ditto. + * src/lyx_gui_misc.C: ditto. + * src/lyxvc.h: ditto. + + * forms/log_form.fd: new file, created from latexoptions.fd. I + kept the log popup and nuked the options form. + + * src/{la,}texoptions.[Ch]: removed. + * src/lyx_cb.C (LaTeXOptions): ditto + + * src/lyx_gui.C (create_forms): do not handle the + fd_latex_options form. + 2000-07-18 Juergen Vigna * src/insets/insetfloat.C (InsetFloat): use setInsetName to set the diff --git a/forms/latexoptions.fd b/forms/latexoptions.fd deleted file mode 100644 index 0eeae1d017..0000000000 --- a/forms/latexoptions.fd +++ /dev/null @@ -1,184 +0,0 @@ -Magic: 13000 - -Internal Form Definition File - (do not change) - -Number of forms: 2 -Unit of measure: FL_COORD_PIXEL - -=============== FORM =============== -Name: LaTeXOptions -Width: 310 -Height: 90 -Number of Objects: 5 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 310 90 -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_CHECKBUTTON -type: PUSH_BUTTON -box: 10 10 310 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: Allow accents on ALL characters|#w -shortcut: -resize: FL_RESIZE_ALL -gravity: FL_NoGravity FL_NoGravity -name: accents -callback: -argument: - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 10 50 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: -callback: LaTeXOptionsOK -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 110 50 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: -callback: LaTeXOptionsApply -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 210 50 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: -callback: LaTeXOptionsCancel -argument: 0 - -=============== FORM =============== -Name: LaTeXLog -Width: 470 -Height: 380 -Number of Objects: 4 - --------------------- -class: FL_BOX -type: UP_BOX -box: 0 0 470 380 -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_BROWSER -type: NORMAL_BROWSER -box: 10 10 450 320 -boxtype: FL_DOWN_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_NorthWest FL_SouthEast -name: browser_latexlog -callback: -argument: - --------------------- -class: FL_BUTTON -type: RETURN_BUTTON -box: 270 340 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: Close -shortcut: ^M -resize: FL_RESIZE_NONE -gravity: FL_SouthEast FL_SouthEast -name: -callback: LatexLogClose -argument: 0 - --------------------- -class: FL_BUTTON -type: NORMAL_BUTTON -box: 370 340 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: Update|#Uu -shortcut: -resize: FL_RESIZE_NONE -gravity: FL_SouthEast FL_SouthEast -name: -callback: LatexLogUpdate -argument: 0 - -============================== -create_the_forms diff --git a/forms/log_form.fd b/forms/log_form.fd new file mode 100644 index 0000000000..f06ba45ca5 --- /dev/null +++ b/forms/log_form.fd @@ -0,0 +1,88 @@ +Magic: 13000 + +Internal Form Definition File + (do not change) + +Number of forms: 1 +Unit of measure: FL_COORD_PIXEL + +=============== FORM =============== +Name: LaTeXLog +Width: 470 +Height: 380 +Number of Objects: 4 + +-------------------- +class: FL_BOX +type: UP_BOX +box: 0 0 470 380 +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_BROWSER +type: NORMAL_BROWSER +box: 10 10 450 320 +boxtype: FL_DOWN_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_NorthWest FL_SouthEast +name: browser_latexlog +callback: +argument: + +-------------------- +class: FL_BUTTON +type: RETURN_BUTTON +box: 270 340 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: Close +shortcut: ^M +resize: FL_RESIZE_NONE +gravity: FL_SouthEast FL_SouthEast +name: +callback: LatexLogClose +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 370 340 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: Update|#Uu +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_SouthEast FL_SouthEast +name: +callback: LatexLogUpdate +argument: 0 + +============================== +create_the_forms diff --git a/forms/makefile b/forms/makefile index 99dcce6f86..03616975ef 100644 --- a/forms/makefile +++ b/forms/makefile @@ -18,15 +18,15 @@ SHELL = /bin/sh FDESIGN = fdesign SRCS = bullet_forms.fd credits_form.fd form1.fd \ - latexoptions.fd layout_forms.fd lyx.fd lyx_sendfax.fd math_forms.fd \ + log_form.fd layout_forms.fd lyx.fd lyx_sendfax.fd math_forms.fd \ print_form.fd sp_form.fd OBJS = bullet_forms.c credits_form.c form1.c \ - latexoptions.c layout_forms.c lyx.c lyx_sendfax.c math_forms.c \ + log_form.c layout_forms.c lyx.c lyx_sendfax.c math_forms.c \ print_form.c sp_form.c COBJS = bullet_forms.C credits_form.C form1.C \ - latexoptions.C layout_forms.C lyx.C lyx_sendfax.C math_forms.C \ + log_form.C layout_forms.C lyx.C lyx_sendfax.C math_forms.C \ print_form.C sp_form.C all: diff --git a/lib/kbd/american.kmap b/lib/kbd/american.kmap index 95a2ebbbec..04cf4ba1a2 100644 --- a/lib/kbd/american.kmap +++ b/lib/kbd/american.kmap @@ -1,18 +1,18 @@ -\kmod ' acute all -\kmod ` grave all -\kmod ~ tilde all -\kmod . dot all -\kmod _ underbar all -\kmod - macron all -\kmod "," cedilla all -\kmod ; underdot all -\kmod ^ circumflex all -\kmod < tie all -\kmod > breve all -\kmod + caron all -\kmod / hugarian_umlaut all -\kmod : umlaut all -\kmod ? circle all +\kmod ' acute native +\kmod ` grave native +\kmod ~ tilde native +\kmod . dot native +\kmod _ underbar native +\kmod - macron native +\kmod "," cedilla native +\kmod ; underdot native +\kmod ^ circumflex native +\kmod < tie native +\kmod > breve native +\kmod + caron native +\kmod / hugarian_umlaut native +\kmod : umlaut native +\kmod ? circle native # \kxmod acute i "\\'{\\i}" # \kxmod grave i "\\`{\\i}" # \kxmod tilde i "\\~{\\i}" diff --git a/po/POTFILES.in b/po/POTFILES.in index fabdfa0ebe..5b1c15fc34 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -69,11 +69,11 @@ src/kbsequence.C src/language.C src/LaTeX.C src/LaTeXLog.C -src/latexoptions.C src/layout.C src/layout_forms.C src/LColor.C src/Literate.C +src/log_form.C src/LyXAction.C src/lyx.C src/lyx_cb.C diff --git a/src/LaTeXLog.C b/src/LaTeXLog.C index a79a05c637..c0e453be36 100644 --- a/src/LaTeXLog.C +++ b/src/LaTeXLog.C @@ -3,7 +3,7 @@ #include #include FORMS_H_LOCATION #include "buffer.h" -#include "latexoptions.h" +#include "log_form.h" #include "lyx_main.h" #include "LString.h" #include "support/FileInfo.h" diff --git a/src/Makefile.am b/src/Makefile.am index 6324609fb3..1fafd15471 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,6 +76,8 @@ lyx_SOURCES = \ ToolbarDefaults.h \ UpdateInset.C \ UpdateInset.h \ + Variables.C \ + Variables.h \ WorkArea.C \ WorkArea.h \ bibforms.h \ @@ -128,12 +130,12 @@ lyx_SOURCES = \ language.h \ lastfiles.C \ lastfiles.h \ - latexoptions.C \ - latexoptions.h \ layout.C \ layout.h \ layout_forms.C \ layout_forms.h \ + log_form.C \ + log_form.h \ lyx.C \ lyx.h \ lyx_cb.C \ @@ -202,7 +204,6 @@ lyx_SOURCES = \ tex-defs.h \ tex-strings.C \ tex-strings.h \ - texoptions.C \ texrow.C \ texrow.h \ text.C \ diff --git a/src/Variables.C b/src/Variables.C new file mode 100644 index 0000000000..128f5538b5 --- /dev/null +++ b/src/Variables.C @@ -0,0 +1,78 @@ +/* This file is part of +* ====================================================== +* +* LyX, The Document Processor +* +* Copyright 1995 Matthias Ettrich +* Copyright 1995-2000 the LyX Team. +* +* ====================================================== */ + +#include + +#ifdef __GNUG__ +#pragma implementation "Variables.h" +#endif + +#include "Variables.h" +#include "support/LRegex.h" + +void Variables::set(string const &var, string const &val) +{ + Vars::const_iterator cit = vars_.find(var); + if (cit != vars_.end()) + vars_.erase(var); + vars_[var] = val;; +} + + +string Variables::get(string const &var) const +{ + Vars::const_iterator cit = vars_.find(var); + if (cit != vars_.end()) + return (*cit).second; + else + return string(); +} + +bool Variables::isset(string const & var) const +{ + Vars::const_iterator cit = vars_.find(var); + return (cit != vars_.end()); +} + +string Variables::expand(string str) const +{ + LRegex reg("\\$\\{\\(.*\\)\\}"); + + if (!reg.exact_match(str)) + return str; + + LRegex::MatchPair match; + string var; + + do { + match = reg.first_match(str); + var = str.substr(match.first,match.second); + // we correct the match to take ${} in account. + str.replace(match.first - 2, match.second + 3, get(var)); + } while (reg.exact_match(str)); + + return str; +} + +#ifdef TEST + +#include +using std::endl; +using std::cout; + +int main() { + Variables vars; + vars.set("x", "hello"); + vars.set("y", "world"); + cout << vars.expand("${x}") << endl; +} + +#endif + diff --git a/src/Variables.h b/src/Variables.h new file mode 100644 index 0000000000..5ffce6057a --- /dev/null +++ b/src/Variables.h @@ -0,0 +1,41 @@ +// -*- C++ -*- +/* This file is part of +* ====================================================== +* +* LyX, The Document Processor +* +* Copyright 1995 Matthias Ettrich +* Copyright 1995-2000 the LyX Team. +* +* ====================================================== */ + +#ifndef VARIABLES_H +#define VARIABLES_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "LString.h" +#include + + +class Variables { +public: + virtual ~Variables() { }; + // + void set(string const &, string const &); + // + virtual string get(string const &) const; + // + bool isset(string const & var) const; + // + string expand(string) const; +private: + // + typedef std::map Vars; + // + Vars vars_; +}; + +#endif diff --git a/src/bufferparams.C b/src/bufferparams.C index afa4c5b6bb..158463fe90 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -62,7 +62,6 @@ BufferParams::BufferParams() user_defined_bullets[iter] = temp_bullets[iter] = ITEMIZE_DEFAULTS[iter]; } - allowAccents = false; } diff --git a/src/bufferparams.h b/src/bufferparams.h index 552028878b..72d601b508 100644 --- a/src/bufferparams.h +++ b/src/bufferparams.h @@ -204,8 +204,6 @@ public: void readLanguage(LyXLex &); /// void readGraphicsDriver(LyXLex &); - /// do we allow accents on all chars in this buffer - bool allowAccents; /// bool use_amsmath; /// Time ago we agreed that this was a buffer property [ale990407] diff --git a/src/latexoptions.C b/src/latexoptions.C deleted file mode 100644 index 650eab3e93..0000000000 --- a/src/latexoptions.C +++ /dev/null @@ -1,62 +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 "latexoptions.h" - -FD_LaTeXOptions *create_form_LaTeXOptions(void) -{ - FL_OBJECT *obj; - FD_LaTeXOptions *fdui = (FD_LaTeXOptions *) fl_calloc(1, sizeof(FD_LaTeXOptions)); - - fdui->LaTeXOptions = fl_bgn_form(FL_NO_BOX, 310, 90); - obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 90, ""); - fdui->accents = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 10, 310, 30, idex(_("Allow accents on ALL characters|#w")));fl_set_button_shortcut(obj, scex(_("Allow accents on ALL characters|#w")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - obj = fl_add_button(FL_RETURN_BUTTON, 10, 50, 90, 30, _("OK")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_callback(obj, LaTeXOptionsOK, 0); - obj = fl_add_button(FL_NORMAL_BUTTON, 110, 50, 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, LaTeXOptionsApply, 0); - obj = fl_add_button(FL_NORMAL_BUTTON, 210, 50, 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, LaTeXOptionsCancel, 0); - fl_end_form(); - - //fdui->LaTeXOptions->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - -FD_LaTeXLog *create_form_LaTeXLog(void) -{ - FL_OBJECT *obj; - FD_LaTeXLog *fdui = (FD_LaTeXLog *) fl_calloc(1, sizeof(FD_LaTeXLog)); - - fdui->LaTeXLog = fl_bgn_form(FL_NO_BOX, 470, 380); - obj = fl_add_box(FL_UP_BOX, 0, 0, 470, 380, ""); - fdui->browser_latexlog = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 10, 450, 320, ""); - fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); - obj = fl_add_button(FL_RETURN_BUTTON, 270, 340, 90, 30, _("Close")); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, LatexLogClose, 0); - obj = fl_add_button(FL_NORMAL_BUTTON, 370, 340, 90, 30, idex(_("Update|#Uu")));fl_set_button_shortcut(obj, scex(_("Update|#Uu")), 1); - fl_set_object_lsize(obj, FL_NORMAL_SIZE); - fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj, LatexLogUpdate, 0); - fl_end_form(); - - //fdui->LaTeXLog->fdui = fdui; - - return fdui; -} -/*---------------------------------------*/ - diff --git a/src/latexoptions.h b/src/latexoptions.h deleted file mode 100644 index 9d63cfb7a7..0000000000 --- a/src/latexoptions.h +++ /dev/null @@ -1,35 +0,0 @@ -/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ - -#ifndef FD_LaTeXOptions_h_ -#define FD_LaTeXOptions_h_ - -/** Callbacks, globals and object handlers **/ -extern "C" void LaTeXOptionsOK(FL_OBJECT *, long); -extern "C" void LaTeXOptionsApply(FL_OBJECT *, long); -extern "C" void LaTeXOptionsCancel(FL_OBJECT *, long); - -extern "C" void LatexLogClose(FL_OBJECT *, long); -extern "C" void LatexLogUpdate(FL_OBJECT *, long); - - -/**** Forms and Objects ****/ -typedef struct { - FL_FORM *LaTeXOptions; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *accents; -} FD_LaTeXOptions; - -extern FD_LaTeXOptions * create_form_LaTeXOptions(void); -typedef struct { - FL_FORM *LaTeXLog; - void *vdata; - char *cdata; - long ldata; - FL_OBJECT *browser_latexlog; -} FD_LaTeXLog; - -extern FD_LaTeXLog * create_form_LaTeXLog(void); - -#endif /* FD_LaTeXOptions_h_ */ diff --git a/src/log_form.C b/src/log_form.C new file mode 100644 index 0000000000..d87147fd1a --- /dev/null +++ b/src/log_form.C @@ -0,0 +1,36 @@ +// 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 "log_form.h" + +FD_LaTeXLog *create_form_LaTeXLog(void) +{ + FL_OBJECT *obj; + FD_LaTeXLog *fdui = (FD_LaTeXLog *) fl_calloc(1, sizeof(FD_LaTeXLog)); + + fdui->LaTeXLog = fl_bgn_form(FL_NO_BOX, 470, 380); + obj = fl_add_box(FL_UP_BOX, 0, 0, 470, 380, ""); + fdui->browser_latexlog = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 10, 450, 320, ""); + fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); + obj = fl_add_button(FL_RETURN_BUTTON, 270, 340, 90, 30, _("Close")); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); + fl_set_object_callback(obj, LatexLogClose, 0); + obj = fl_add_button(FL_NORMAL_BUTTON, 370, 340, 90, 30, idex(_("Update|#Uu")));fl_set_button_shortcut(obj, scex(_("Update|#Uu")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); + fl_set_object_callback(obj, LatexLogUpdate, 0); + fl_end_form(); + + //fdui->LaTeXLog->fdui = fdui; + + return fdui; +} +/*---------------------------------------*/ + diff --git a/src/log_form.h b/src/log_form.h new file mode 100644 index 0000000000..e16dd59fe1 --- /dev/null +++ b/src/log_form.h @@ -0,0 +1,22 @@ +/** Header file generated with fdesign on Mon Jul 17 21:08:23 2000.**/ + +#ifndef FD_LaTeXLog_h_ +#define FD_LaTeXLog_h_ + +/** Callbacks, globals and object handlers **/ +extern "C" void LatexLogClose(FL_OBJECT *, long); +extern "C" void LatexLogUpdate(FL_OBJECT *, long); + + +/**** Forms and Objects ****/ +typedef struct { + FL_FORM *LaTeXLog; + void *vdata; + char *cdata; + long ldata; + FL_OBJECT *browser_latexlog; +} FD_LaTeXLog; + +extern FD_LaTeXLog * create_form_LaTeXLog(void); + +#endif /* FD_LaTeXLog_h_ */ diff --git a/src/lyx_cb.C b/src/lyx_cb.C index cd43250aae..013b8b02da 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -73,7 +73,6 @@ extern FD_form_figure * fd_form_figure; extern FD_form_screen * fd_form_screen; extern FD_form_toc * fd_form_toc; extern FD_form_ref * fd_form_ref; -extern FD_LaTeXOptions * fd_latex_options; extern FD_form_bullet * fd_form_bullet; extern BufferView * current_view; // called too many times in this file... @@ -2816,24 +2815,6 @@ extern "C" void ScreenOKCB(FL_OBJECT * ob, long data) } -void LaTeXOptions(BufferView * bv) -{ - if (!bv->available()) - return; - - fl_set_button(fd_latex_options->accents, - int(bv->buffer()->params.allowAccents)); - - if (fd_latex_options->LaTeXOptions->visible) { - fl_raise_form(fd_latex_options->LaTeXOptions); - } else { - fl_show_form(fd_latex_options->LaTeXOptions, - FL_PLACE_MOUSE, FL_FULLBORDER, - _("LaTeX Options")); - } -} - - // This function runs "configure" and then rereads lyx.defaults to // reconfigure the automatic settings. void Reconfigure(BufferView * bv) diff --git a/src/lyx_gui.C b/src/lyx_gui.C index 9ef74685b1..1e66bf72d7 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -29,7 +29,7 @@ #include "print_form.h" #include "tex-strings.h" #include "lyx_main.h" -#include "latexoptions.h" +#include "log_form.h" #include "debug.h" #include "version.h" #include "LyXView.h" @@ -67,8 +67,7 @@ FD_form_figure * fd_form_figure; FD_form_screen * fd_form_screen; FD_form_toc * fd_form_toc; FD_form_ref * fd_form_ref; -FD_LaTeXOptions * fd_latex_options; // from latexoptions.h -FD_LaTeXLog * fd_latex_log; // from latexoptions.h +FD_LaTeXLog * fd_latex_log; // from log_form.h Combox * combo_language; Combox * combo_language2; @@ -559,11 +558,6 @@ void LyXGUI::create_forms() fl_set_form_minsize(fd_form_ref->form_ref, fd_form_ref->form_ref->w, fd_form_ref->form_ref->h); - // the latex options form - fd_latex_options = create_form_LaTeXOptions(); - fl_set_form_atclose(fd_latex_options->LaTeXOptions, - CancelCloseBoxCB, 0); - // the latex log form fd_latex_log = create_form_LaTeXLog(); fl_set_form_atclose(fd_latex_log->LaTeXLog, diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index 3721ee3ff3..1be9c7f4fc 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -20,7 +20,7 @@ #include "form1.h" #include "gettext.h" #include "include_form.h" -#include "latexoptions.h" +#include "log_form.h" #include "layout_forms.h" #include "lyx.h" #include "lyx_cb.h" diff --git a/src/lyxvc.h b/src/lyxvc.h index ee4df7ba60..706a5639f1 100644 --- a/src/lyxvc.h +++ b/src/lyxvc.h @@ -8,7 +8,7 @@ #endif #include "LString.h" -#include "latexoptions.h" +#include "log_form.h" class VCS; class Buffer; diff --git a/src/menus.C b/src/menus.C index 403fbf1e54..d09b79baa6 100644 --- a/src/menus.C +++ b/src/menus.C @@ -69,7 +69,6 @@ extern BufferList bufferlist; extern void MenuLayoutSave(); extern void ShowCredits(); extern void show_symbols_form(LyXFunc *); -extern void LaTeXOptions(BufferView *); // A bunch of wrappers @@ -1979,17 +1978,15 @@ void Menus::ShowOptionsMenu(FL_OBJECT * ob, long) int OptionsMenu = fl_defpup(FL_ObjWin(ob), _("Screen Fonts..." "|Spellchecker Options..." - "|Keyboard..." - "|LaTeX...%l" + "|Keyboard...%l" "|Reconfigure" "|Preferences")); fl_setpup_shortcut(OptionsMenu, 1, scex(_("OM|Ff#f#F"))); fl_setpup_shortcut(OptionsMenu, 2, scex(_("OM|Ss#s#S"))); fl_setpup_shortcut(OptionsMenu, 3, scex(_("OM|Kk#k#K"))); - fl_setpup_shortcut(OptionsMenu, 4, scex(_("OM|Ll#l#L"))); - fl_setpup_shortcut(OptionsMenu, 5, scex(_("OM|Rr#r#R"))); - fl_setpup_shortcut(OptionsMenu, 6, scex(_("OM|Pp#p#P"))); + fl_setpup_shortcut(OptionsMenu, 4, scex(_("OM|Rr#r#R"))); + fl_setpup_shortcut(OptionsMenu, 5, scex(_("OM|Pp#p#P"))); if(lyxrc.isp_command == "none") fl_setpup_mode(OptionsMenu, 2, FL_PUP_GREY); @@ -2007,9 +2004,8 @@ void Menus::ShowOptionsMenu(FL_OBJECT * ob, long) case 1: men->ScreenOptions(); break; case 2: SpellCheckerOptions(); break; case 3: men->_view->getIntl()->MenuKeymap(); break; - case 4: LaTeXOptions(men->_view->view()); break; - case 5: tmpfunc->Dispatch(LFUN_RECONFIGURE); break; - case 6: men->_view->getDialogs()->showPreferences(); break; + case 4: tmpfunc->Dispatch(LFUN_RECONFIGURE); break; + case 5: men->_view->getDialogs()->showPreferences(); break; default: break; } fl_freepup(OptionsMenu); diff --git a/src/texoptions.C b/src/texoptions.C deleted file mode 100644 index c54e165ab5..0000000000 --- a/src/texoptions.C +++ /dev/null @@ -1,41 +0,0 @@ -/* This file is part of -* ====================================================== -* -* LyX, The Document Processor -* -* Copyright 1995 Matthias Ettrich -* Copyright 1995-2000 The LyX Team. -* -* This file is Copyleft 1996-2000 -* Lars Gullik Bjønnes -* -* ====================================================== */ - -#include -#include FORMS_H_LOCATION -#include "latexoptions.h" -#include "lyx_main.h" -#include "buffer.h" -#include "BufferView.h" - -extern FD_LaTeXOptions * fd_latex_options; -extern BufferView * current_view; - -void LaTeXOptionsOK(FL_OBJECT * ob, long data) -{ - LaTeXOptionsApply(ob, data); - LaTeXOptionsCancel(ob, data); -} - -void LaTeXOptionsApply(FL_OBJECT *, long) -{ - if (fl_get_button(fd_latex_options->accents)) - current_view->buffer()->params.allowAccents = true; - else - current_view->buffer()->params.allowAccents = false; -} - -void LaTeXOptionsCancel(FL_OBJECT *, long) -{ - fl_hide_form(fd_latex_options->LaTeXOptions); -} diff --git a/src/trans.C b/src/trans.C index fd777ac4ae..066694fc2b 100644 --- a/src/trans.C +++ b/src/trans.C @@ -150,7 +150,7 @@ void Trans::AddDeadkey(tex_accent accent, string const & keys, kmod_list_[accent] = new kmod_list_decl; kmod_list_[accent]->data = keys; kmod_list_[accent]->accent = accent; - if (allowed == "all") { + if (allowed == "native") { kmod_list_[accent]->allowed= lyx_accent_table[accent].native; } else { kmod_list_[accent]->allowed = allowed; diff --git a/src/trans_mgr.C b/src/trans_mgr.C index 05b84f64a1..eea9e01464 100644 --- a/src/trans_mgr.C +++ b/src/trans_mgr.C @@ -85,8 +85,7 @@ string TransDeadkeyState::normalkey(char c, char * trans) } if (l == 0) { // Not an exception. Check if it allowed - if (current_view->buffer()->params.allowAccents == true || - countChar(deadkey_info_.allowed, c) > 0) { + if (countChar(deadkey_info_.allowed, c) > 0) { res = DoAccent(c, deadkey_info_.accent); } else { // Not allowed