patch from Dekel + some simplifications

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1175 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-10-30 21:53:29 +00:00
parent dafce403dd
commit 235f7c1d2a
18 changed files with 1578 additions and 834 deletions

View File

@ -1,3 +1,43 @@
2000-10-30 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/tabular.C (AsciiBottomHLine): simplify?
(AsciiTopHLine): simplify?
(print_n_chars): simplify
(DocBook): remove most of the << endl; we should flush the stream
as seldom as possible.
(Latex): ditto
(TeXBottomHLine): ditto
(TeXTopHLine): ditto
(Write): formatting
(write_attribute): try a templified version.
(set_row_column_number_info): lesson scope of variables
* src/support/lstrings.h (tostr): new specialization of tostr
* src/trans.C (AddDeadkey): slightly cleaner fix.
2000-10-28 Dekel Tsur <dekelts@tau.ac.il>
* src/frontends/xforms/Menubar_pimpl.C (add_toc): Replace '%' by
'%%' in Toc menu labels.
(add_toc2): ditto
* src/insets/insetlatexaccent.C (draw): Correct rendering when
font_norm is iso10646-1.
* src/font.C (ascent): Fixed for 16bit fonts
(descent,lbearing,rbearing): ditto
2000-10-30 Angus Leeming <a.leeming@ic.ac.uk>
* src/lyxrc.C.[Ch]: moved LyXRCTags into public part of header file.
(getFeedback): new static method.
* src/frontends/xforms/FormPreferences.[Ch]: one or two new inputs.
Now use combox rather than choice to display languages.
Feedback is now output using a new timer callback mechanism, identical
to that in Toolbar_pimpl. Individual messages obtained from lyxrc.
2000-10-30 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/minibuffer.C: fix for older compilers

View File

@ -121,7 +121,7 @@ WorkArea::WorkArea(BufferView * o, int xpos, int ypos, int width, int height)
<< width - 15 - 2 * bw << 'x'
<< height - 2 * bw << endl;
work_area = obj = fl_add_free(FL_INPUT_FREE,
work_area = obj = fl_add_free(FL_ALL_FREE,
xpos + bw, ypos + bw,
width - 15 - 2 * bw, // scrollbarwidth
height - 2 * bw, "",
@ -309,7 +309,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
ev->xbutton.y - ob->y,
ev->xbutton.button);
break;
case FL_MOUSE:
case FL_DRAG:
if (!ev || ! area->scrollbar) break;
if (ev->xmotion.x != x_old ||
ev->xmotion.y != y_old ||
@ -321,7 +321,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
ev->xbutton.state);
}
break;
case FL_KEYBOARD:
case FL_KEYPRESS:
{
lyxerr[Debug::KEY] << "Workarea event: KEYBOARD" << endl;
@ -408,6 +408,10 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
area->workAreaKeyPress(ret_key, ret_state);
}
break;
case FL_KEYRELEASE:
lyxerr << "Workarea event: KEYRELEASE" << endl;
break;
case FL_FOCUS:
lyxerr[Debug::GUI] << "Workarea event: FOCUS" << endl;
area->workAreaFocus();

View File

@ -55,7 +55,7 @@ int lyxfont::ascent(char c, LyXFont const & f)
unsigned int uc = static_cast<unsigned char>(c);
if (finfo->per_char
&& uc >= finfo->min_char_or_byte2
&& uc <= finfo->max_char_or_byte2)
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
return finfo->per_char[uc - finfo->min_char_or_byte2].ascent;
else
return finfo->ascent;
@ -68,7 +68,7 @@ int lyxfont::descent(char c, LyXFont const & f)
unsigned int uc = static_cast<unsigned char>(c);
if (finfo->per_char
&& uc >= finfo->min_char_or_byte2
&& uc <= finfo->max_char_or_byte2)
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
return finfo->per_char[uc - finfo->min_char_or_byte2].descent;
else
return finfo->descent;
@ -81,7 +81,7 @@ int lyxfont::lbearing(char c, LyXFont const & f)
unsigned int uc = static_cast<unsigned char>(c);
if (finfo->per_char
&& uc >= finfo->min_char_or_byte2
&& uc <= finfo->max_char_or_byte2)
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
return finfo->per_char[uc - finfo->min_char_or_byte2].lbearing;
else
return 0;
@ -94,7 +94,7 @@ int lyxfont::rbearing(char c, LyXFont const & f)
unsigned int uc = static_cast<unsigned char>(c);
if (finfo->per_char
&& uc >= finfo->min_char_or_byte2
&& uc <= finfo->max_char_or_byte2)
&& uc <= finfo->max_char_or_byte2+256*finfo->max_byte1)
return finfo->per_char[uc - finfo->min_char_or_byte2].rbearing;
else
return width(c, f);

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,7 @@ struct FD_form_outputs_misc;
struct FD_form_spellchecker;
struct FD_form_language;
struct FD_form_colours;
class Combox;
/** This class provides an XForms implementation of the FormPreferences Dialog.
The preferences dialog allows users to set/save their preferences.
@ -48,6 +49,14 @@ public:
FormPreferences(LyXView *, Dialogs *);
///
~FormPreferences();
///
static void ComboLanguageCB(int, void *, Combox *);
///
static void FeedbackCB(FL_OBJECT *, long);
///
static int FeedbackPost(FL_OBJECT *ob, int, FL_Coord, FL_Coord,
int, void *);
private:
///
enum State {
@ -70,10 +79,9 @@ private:
///
SCREENFONTS,
///
SPELLCHECKER,
///
TABS
SPELLCHECKER
};
/// Update the dialog.
virtual void update();
///
@ -88,6 +96,8 @@ private:
virtual bool input(FL_OBJECT *, long);
/// Build the dialog
virtual void build();
/// control which feedback message is output
void feedback( FL_OBJECT * ob );
///
virtual FL_FORM * form() const;
///
@ -119,6 +129,8 @@ private:
///
void buildLanguage();
///
void addLanguages( Combox & );
///
void buildLnFmisc();
///
void buildOutputsMisc();
@ -185,6 +197,8 @@ private:
bool ReadableDir( string const & ) const;
///
bool WriteableFile( string const &, string const & = string() ) const;
///
void setPostHandler( FL_OBJECT * ) const;
///
FD_form_preferences * build_preferences();
@ -241,6 +255,12 @@ private:
FD_form_screen_fonts * screen_fonts_;
///
FD_form_spellchecker * spellchecker_;
///
Combox * combo_default_lang;
///
Combox * combo_kbmap_1;
///
Combox * combo_kbmap_2;
};
#endif

View File

@ -205,6 +205,16 @@ int get_new_submenu(vector<int> & smn, Window win)
size_type const max_number_of_items = 25;
inline
string const fixlabel(string const & str)
{
#if FL_REVISION < 89
return subst(str, '%', '?');
#else
return subst(str, "%", "%%");
#endif
}
void add_toc2(int menu, string const & extra_label,
vector<int> & smn, Window win,
vector<Buffer::TocItem> const & toc_list,
@ -216,7 +226,7 @@ void add_toc2(int menu, string const & extra_label,
getPseudoAction(LFUN_GOTO_PARAGRAPH,
tostr(toc_list[i].par->id()));
string label(4 * max(0, toc_list[i].depth - depth),' ');
label += toc_list[i].str;
label += fixlabel(toc_list[i].str);
label = limit_string_length(label);
label += "%x" + tostr(action);
if (i == to - 1 && depth == 0)
@ -248,7 +258,7 @@ void add_toc2(int menu, string const & extra_label,
getPseudoAction(LFUN_GOTO_PARAGRAPH,
tostr(toc_list[pos].par->id()));
string label(4 * max(0, toc_list[pos].depth - depth), ' ');
label += toc_list[pos].str;
label += fixlabel(toc_list[pos].str);
label = limit_string_length(label);
if (new_pos == to && depth == 0)
label += extra_label;
@ -298,8 +308,8 @@ void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
int action = lyxaction.
getPseudoAction(LFUN_GOTO_PARAGRAPH,
tostr(toc_list[j][i].par->id()));
string label =
limit_string_length(toc_list[j][i].str);
string label = fixlabel(toc_list[j][i].str);
label = limit_string_length(label);
label += "%x" + tostr(action);
fl_addtopup(menu2, label.c_str());
}

View File

@ -27,7 +27,6 @@ FD_form_preferences * FormPreferences::build_preferences()
obj = fl_add_box(FL_UP_BOX, 0, 0, 470, 500, "");
fdui->tabfolder_prefs = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 10, 455, 375, "");
fl_set_object_boxtype(obj, FL_FLAT_BOX);
fl_set_object_callback(obj, C_FormBaseInputCB, TABS);
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 270, 390, 90, 30, idex(_("Apply|#A")));
fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -46,6 +45,7 @@ FD_form_preferences * FormPreferences::build_preferences()
obj = fl_add_frame(FL_ENGRAVED_FRAME, 0, 425, 470, 1, "");
fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 5, 430, 460, 70, "");
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fdui->timer_feedback = obj = fl_add_timer(FL_HIDDEN_TIMER, 107, 390, 50, 30, "");
fl_end_form();
fdui->form->fdui = fdui;
@ -71,7 +71,6 @@ FD_form_outer_tab * FormPreferences::build_outer_tab()
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 455, 375, "");
fdui->tabfolder_outer = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 0, 0, 455, 375, "");
fl_set_object_boxtype(obj, FL_FLAT_BOX);
fl_set_object_callback(obj, C_FormBaseInputCB, TABS);
fl_end_form();
fdui->form->fdui = fdui;
@ -104,50 +103,60 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts()
fdui->input_typewriter = obj = fl_add_input(FL_NORMAL_INPUT, 210, 65, 200, 30, _("Typewriter"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->counter_zoom = obj = fl_add_counter(FL_SIMPLE_COUNTER, 210, 125, 200, 30, _("%"));
fdui->counter_zoom = obj = fl_add_counter(FL_SIMPLE_COUNTER, 345, 130, 65, 30, idex(_("Zoom %|#Z")));
fl_set_button_shortcut(obj, scex(_("Zoom %|#Z")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fl_set_counter_precision(obj, 0);
fl_set_counter_bounds(obj, 0, 999);
fl_set_counter_value(obj, 150);
fl_set_counter_step(obj, 1, 1);
fdui->check_scalable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 168, 125, 33, 31, _("Allow scaling"));
fdui->check_scalable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 60, 143, 33, 31, _("Use scalable fonts"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fl_set_button(obj, 1);
fdui->input_screen_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 210, 95, 200, 30, _("Encoding"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_tiny = obj = fl_add_input(FL_FLOAT_INPUT, 140, 165, 70, 30, _("tiny"));
fdui->input_script = obj = fl_add_input(FL_FLOAT_INPUT, 200, 199, 70, 30, _("script"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_script = obj = fl_add_input(FL_FLOAT_INPUT, 340, 165, 70, 30, _("script"));
fdui->input_footnote = obj = fl_add_input(FL_FLOAT_INPUT, 340, 198, 70, 30, _("footnote"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_footnote = obj = fl_add_input(FL_FLOAT_INPUT, 140, 195, 70, 30, _("footnote"));
fdui->input_large = obj = fl_add_input(FL_FLOAT_INPUT, 340, 228, 70, 30, _("large"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_small = obj = fl_add_input(FL_FLOAT_INPUT, 340, 195, 70, 30, _("small"));
fdui->input_largest = obj = fl_add_input(FL_FLOAT_INPUT, 200, 259, 70, 30, _("largest"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_large = obj = fl_add_input(FL_FLOAT_INPUT, 340, 225, 70, 30, _("large"));
fdui->input_huge = obj = fl_add_input(FL_FLOAT_INPUT, 340, 258, 70, 30, _("huge"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_larger = obj = fl_add_input(FL_FLOAT_INPUT, 140, 255, 70, 30, _("larger"));
fdui->input_normal = obj = fl_add_input(FL_FLOAT_INPUT, 200, 229, 70, 30, _("normal"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_largest = obj = fl_add_input(FL_FLOAT_INPUT, 340, 255, 70, 30, _("largest"));
fdui->counter_dpi = obj = fl_add_counter(FL_SIMPLE_COUNTER, 345, 162, 65, 30, idex(_("Screen DPI|#D")));
fl_set_button_shortcut(obj, scex(_("Screen DPI|#D")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fl_set_counter_precision(obj, 0);
fl_set_counter_bounds(obj, 0, 999);
fl_set_counter_value(obj, 150);
fl_set_counter_step(obj, 1, 1);
fdui->input_tiny = obj = fl_add_input(FL_FLOAT_INPUT, 60, 198, 70, 30, _("tiny"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_normal = obj = fl_add_input(FL_FLOAT_INPUT, 140, 225, 70, 30, _("normal"));
fdui->input_larger = obj = fl_add_input(FL_FLOAT_INPUT, 60, 258, 70, 30, _("larger"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_huge = obj = fl_add_input(FL_FLOAT_INPUT, 140, 285, 70, 30, _("huge"));
fdui->input_small = obj = fl_add_input(FL_FLOAT_INPUT, 60, 228, 70, 30, _("small"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fdui->input_huger = obj = fl_add_input(FL_FLOAT_INPUT, 340, 285, 70, 30, _("huger"));
fdui->input_huger = obj = fl_add_input(FL_FLOAT_INPUT, 60, 288, 70, 30, _("huger"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, SCREENFONTS);
fl_end_form();
@ -316,6 +325,14 @@ FD_form_language * FormPreferences::build_language()
fdui->form = fl_bgn_form(FL_NO_BOX, 450, 360);
fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 360, "");
fdui->input_package = obj = fl_add_input(FL_NORMAL_INPUT, 131, 18, 300, 30, idex(_("Package|#P")));
fl_set_button_shortcut(obj, scex(_("Package|#P")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->choice_default_lang = obj = fl_add_choice(FL_NORMAL_CHOICE, 231, 56, 200, 30, idex(_("Default language|#D")));
fl_set_button_shortcut(obj, scex(_("Default language|#D")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->check_use_kbmap = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 158, 113, 30, 30, idex(_("Keyboard map|#K")));
fl_set_button_shortcut(obj, scex(_("Keyboard map|#K")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -325,6 +342,10 @@ FD_form_language * FormPreferences::build_language()
fl_set_button_shortcut(obj, scex(_("1st|#1")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->choice_kbmap_2 = obj = fl_add_choice(FL_NORMAL_CHOICE, 231, 128, 200, 30, idex(_("2nd|#2")));
fl_set_button_shortcut(obj, scex(_("2nd|#2")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->check_rtl_support = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 154, 161, 30, 30, idex(_("RtL support|#R")));
fl_set_button_shortcut(obj, scex(_("RtL support|#R")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -335,19 +356,15 @@ FD_form_language * FormPreferences::build_language()
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->check_auto_end = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 362, 187, 30, 30, idex(_("Auto finish|#f")));
fl_set_button_shortcut(obj, scex(_("Auto finish|#f")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->check_auto_begin = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 362, 161, 30, 30, idex(_("Auto begin|#b")));
fl_set_button_shortcut(obj, scex(_("Auto begin|#b")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->input_package = obj = fl_add_input(FL_NORMAL_INPUT, 131, 18, 300, 30, idex(_("Package|#P")));
fl_set_button_shortcut(obj, scex(_("Package|#P")), 1);
fdui->check_auto_end = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 362, 187, 30, 30, idex(_("Auto finish|#f")));
fl_set_button_shortcut(obj, scex(_("Auto finish|#f")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->input_command_begin = obj = fl_add_input(FL_NORMAL_INPUT, 131, 224, 300, 30, idex(_("Command start|#s")));
fl_set_button_shortcut(obj, scex(_("Command start|#s")), 1);
@ -357,14 +374,6 @@ FD_form_language * FormPreferences::build_language()
fl_set_button_shortcut(obj, scex(_("Command end|#e")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->choice_kbmap_2 = obj = fl_add_choice(FL_NORMAL_CHOICE, 231, 128, 200, 30, idex(_("2nd|#2")));
fl_set_button_shortcut(obj, scex(_("2nd|#2")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fdui->choice_default_lang = obj = fl_add_choice(FL_NORMAL_CHOICE, 231, 56, 200, 30, idex(_("Default language|#D")));
fl_set_button_shortcut(obj, scex(_("Default language|#D")), 1);
fl_set_object_boxtype(obj, FL_FRAME_BOX);
fl_set_object_callback(obj, C_FormBaseInputCB, LANGUAGE);
fl_end_form();
fdui->form->fdui = fdui;

View File

@ -5,13 +5,11 @@
#define FD_form_preferences_h_
/** Callbacks, globals and object handlers **/
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
extern "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
extern "C" void C_FormBaseOKCB(FL_OBJECT *, long);
extern "C" void C_FormBaseRestoreCB(FL_OBJECT *, long);
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
extern "C" void C_FormBaseInputCB(FL_OBJECT *, long);
@ -44,6 +42,7 @@ struct FD_form_preferences {
FL_OBJECT *button_ok;
FL_OBJECT *button_restore;
FL_OBJECT *text_warning;
FL_OBJECT *timer_feedback;
};
struct FD_form_outer_tab {
~FD_form_outer_tab();
@ -61,15 +60,16 @@ struct FD_form_screen_fonts {
FL_OBJECT *counter_zoom;
FL_OBJECT *check_scalable;
FL_OBJECT *input_screen_encoding;
FL_OBJECT *input_tiny;
FL_OBJECT *input_script;
FL_OBJECT *input_footnote;
FL_OBJECT *input_small;
FL_OBJECT *input_large;
FL_OBJECT *input_larger;
FL_OBJECT *input_largest;
FL_OBJECT *input_normal;
FL_OBJECT *input_huge;
FL_OBJECT *input_normal;
FL_OBJECT *counter_dpi;
FL_OBJECT *input_tiny;
FL_OBJECT *input_larger;
FL_OBJECT *input_small;
FL_OBJECT *input_huger;
};
struct FD_form_outputs_misc {
@ -107,17 +107,17 @@ struct FD_form_language {
~FD_form_language();
FL_FORM *form;
FL_OBJECT *input_package;
FL_OBJECT *choice_default_lang;
FL_OBJECT *check_use_kbmap;
FL_OBJECT *choice_kbmap_1;
FL_OBJECT *choice_kbmap_2;
FL_OBJECT *check_rtl_support;
FL_OBJECT *check_mark_foreign;
FL_OBJECT *check_auto_end;
FL_OBJECT *check_auto_begin;
FL_OBJECT *input_package;
FL_OBJECT *check_auto_end;
FL_OBJECT *input_command_begin;
FL_OBJECT *input_command_end;
FL_OBJECT *choice_kbmap_2;
FL_OBJECT *choice_default_lang;
};
struct FD_form_colours {
~FD_form_colours();

View File

@ -11,7 +11,7 @@ SnapGrid: 1
Name: form_preferences
Width: 470
Height: 500
Number of Objects: 8
Number of Objects: 9
--------------------
class: FL_BOX
@ -46,8 +46,8 @@ shortcut:
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: tabfolder_prefs
callback: C_FormBaseInputCB
argument: TABS
callback:
argument:
--------------------
class: FL_BUTTON
@ -157,6 +157,24 @@ name: text_warning
callback:
argument:
--------------------
class: FL_TIMER
type: HIDDEN_TIMER
box: 107 390 50 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_RED
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: timer_feedback
callback:
argument:
=============== FORM ===============
Name: form_outer_tab
Width: 455
@ -196,14 +214,14 @@ shortcut:
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: tabfolder_outer
callback: C_FormBaseInputCB
argument: TABS
callback:
argument:
=============== FORM ===============
Name: form_screen_fonts
Width: 455
Height: 375
Number of Objects: 17
Number of Objects: 18
--------------------
class: FL_BOX
@ -280,14 +298,14 @@ argument: SCREENFONTS
--------------------
class: FL_COUNTER
type: SIMPLE_COUNTER
box: 210 125 200 30
box: 345 130 65 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_BLUE
alignment: FL_ALIGN_RIGHT
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: %
label: Zoom %|#Z
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
@ -302,14 +320,14 @@ argument: SCREENFONTS
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
box: 168 125 33 31
box: 60 143 33 31
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_LEFT
alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Allow scaling
label: Use scalable fonts
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
@ -339,25 +357,7 @@ argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 140 165 70 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: tiny
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_tiny
callback: C_FormBaseInputCB
argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 340 165 70 30
box: 200 199 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -375,7 +375,7 @@ argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 140 195 70 30
box: 340 198 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -393,25 +393,7 @@ argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 340 195 70 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: small
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_small
callback: C_FormBaseInputCB
argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 340 225 70 30
box: 340 228 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -429,25 +411,7 @@ argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 140 255 70 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: larger
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_larger
callback: C_FormBaseInputCB
argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 340 255 70 30
box: 200 259 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -465,25 +429,7 @@ argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 140 225 70 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: normal
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_normal
callback: C_FormBaseInputCB
argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 140 285 70 30
box: 340 258 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -501,7 +447,101 @@ argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 340 285 70 30
box: 200 229 70 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: normal
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_normal
callback: C_FormBaseInputCB
argument: SCREENFONTS
--------------------
class: FL_COUNTER
type: SIMPLE_COUNTER
box: 345 162 65 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: Screen DPI|#D
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: counter_dpi
callback: C_FormBaseInputCB
argument: SCREENFONTS
bounds: 0 999
precision: 0
value: 150
sstep: 1
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 60 198 70 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: tiny
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_tiny
callback: C_FormBaseInputCB
argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 60 258 70 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: larger
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_larger
callback: C_FormBaseInputCB
argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 60 228 70 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: small
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_small
callback: C_FormBaseInputCB
argument: SCREENFONTS
--------------------
class: FL_INPUT
type: FLOAT_INPUT
box: 60 288 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
@ -922,6 +962,42 @@ name:
callback:
argument:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 131 18 300 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: Package|#P
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_package
callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 231 56 200 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Default language|#D
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_default_lang
callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
@ -958,6 +1034,24 @@ name: choice_kbmap_1
callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 231 128 200 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: 2nd|#2
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_kbmap_2
callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
@ -994,24 +1088,6 @@ name: check_mark_foreign
callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
box: 362 187 30 30
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: Auto finish|#f
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: check_auto_end
callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
@ -1031,20 +1107,20 @@ callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 131 18 300 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
class: FL_CHECKBUTTON
type: PUSH_BUTTON
box: 362 187 30 30
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: Package|#P
label: Auto finish|#f
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_package
name: check_auto_end
callback: C_FormBaseInputCB
argument: LANGUAGE
@ -1084,42 +1160,6 @@ name: input_command_end
callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 231 128 200 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: 2nd|#2
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_kbmap_2
callback: C_FormBaseInputCB
argument: LANGUAGE
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 231 56 200 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Default language|#D
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: choice_default_lang
callback: C_FormBaseInputCB
argument: LANGUAGE
=============== FORM ===============
Name: form_colours
Width: 450

View File

@ -354,19 +354,23 @@ bool InsetLatexAccent::DisplayISO8859_9(BufferView * bv, LyXFont const & font,
}
void InsetLatexAccent::draw(BufferView * bv, LyXFont const & font,
void InsetLatexAccent::draw(BufferView * bv, LyXFont const & font0,
int baseline, float & x, bool) const
{
Painter & pain = bv->painter();
if (lyxrc.font_norm == "iso8859-9")
if (DisplayISO8859_9(bv, font, baseline, x))
if (lyxrc.font_norm_type == LyXRC::ISO_8859_9)
if (DisplayISO8859_9(bv, font0, baseline, x))
return;
/* draw it! */
// All the manually drawn accents in this function could use an
// overhaul. Different ways of drawing (what metrics to use)
// should also be considered.
LyXFont font(font0);
if (lyxrc.font_norm_type == LyXRC::ISO_10646_1)
font.setLanguage(english_language);
if (candisp) {
int asc = ascent(bv, font);

View File

@ -146,7 +146,7 @@ string const InsetQuotes::DispString() const
if (times == InsetQuotes::DoubleQ)
disp += disp;
if (lyxrc.font_norm == "iso8859-1")
if (lyxrc.font_norm_type == LyXRC::ISO_8859_1)
if (disp == "<<")
disp = '«';
else if (disp == ">>")

View File

@ -25,6 +25,7 @@
using std::endl;
Languages languages;
Language const * english_language;
Language const * default_language;
Language ignore_lang("ignore", "ignore", "Ignore", false, 0, "ignore");
Language const * ignore_language = &ignore_lang;
@ -35,7 +36,7 @@ void Languages::setDefaults()
false,
encodings.getEncoding("iso8859-1"),
"en");
default_language = &languagelist["english"];
english_language = default_language = &languagelist["english"];
}
void Languages::read(string const & filename)
@ -87,6 +88,9 @@ void Languages::read(string const & filename)
lyxerr << "Using \"" << default_language->lang()
<< "\" instead!" << endl;
}
english_language = getLanguage("english");
if (!english_language)
english_language = default_language;
}
Language const * Languages::getLanguage(string const & language) const

View File

@ -101,6 +101,7 @@ private:
extern Languages languages;
extern Language const * default_language;
extern Language const * english_language;
extern Language const *ignore_language;
#endif

View File

@ -46,193 +46,98 @@ extern LyXAction lyxaction;
extern kb_keymap * toplevel_keymap;
enum LyXRCTags {
RC_FONT_ENCODING = 1,
RC_PRINTER,
RC_PRINT_COMMAND,
RC_PRINTEVENPAGEFLAG,
RC_PRINTODDPAGEFLAG,
RC_PRINTPAGERANGEFLAG,
RC_PRINTCOPIESFLAG,
RC_PRINTCOLLCOPIESFLAG,
RC_PRINTREVERSEFLAG,
RC_PRINTLANDSCAPEFLAG,
RC_PRINTTOPRINTER,
RC_PRINT_ADAPTOUTPUT,
RC_PRINTTOFILE,
RC_PRINTFILEEXTENSION,
RC_PRINTEXSTRAOPTIONS,
RC_PRINTSPOOL_COMMAND,
RC_PRINTSPOOL_PRINTERPREFIX,
RC_PRINTPAPERFLAG,
RC_PRINTPAPERDIMENSIONFLAG,
RC_CUSTOM_EXPORT_COMMAND,
RC_CUSTOM_EXPORT_FORMAT,
RC_SCREEN_DPI,
RC_SCREEN_ZOOM,
RC_SCREEN_FONT_SIZES,
RC_SCREEN_FONT_ROMAN,
RC_SCREEN_FONT_SANS,
RC_SCREEN_FONT_TYPEWRITER,
RC_SCREEN_FONT_MENU,
RC_SCREEN_FONT_POPUP,
RC_SCREEN_FONT_ENCODING,
RC_SCREEN_FONT_ENCODING_MENU,
RC_SET_COLOR,
RC_AUTOSAVE,
RC_DOCUMENTPATH,
RC_TEMPLATEPATH,
RC_TEMPDIRPATH,
RC_USETEMPDIR,
RC_LASTFILES,
RC_AUTOREGIONDELETE,
RC_BIND,
RC_OVERRIDE_X_DEADKEYS,
RC_SERVERPIPE,
RC_INPUT,
RC_BINDFILE,
RC_UIFILE,
RC_KBMAP,
RC_KBMAP_PRIMARY,
RC_KBMAP_SECONDARY,
RC_FAX_COMMAND,
RC_PHONEBOOK,
RC_FAXPROGRAM,
RC_ASCIIROFF_COMMAND,
RC_ASCII_LINELEN,
RC_NUMLASTFILES,
RC_CHECKLASTFILES,
RC_VIEWDVI_PAPEROPTION,
RC_DEFAULT_PAPERSIZE,
RC_PS_COMMAND,
RC_ACCEPT_COMPOUND,
RC_SPELL_COMMAND,
RC_USE_INP_ENC,
RC_USE_ALT_LANG,
RC_USE_PERS_DICT,
RC_USE_ESC_CHARS,
RC_SCREEN_FONT_SCALABLE,
RC_ALT_LANG,
RC_PERS_DICT,
RC_ESC_CHARS,
RC_CHKTEX_COMMAND,
RC_CURSOR_FOLLOWS_SCROLLBAR,
RC_EXIT_CONFIRMATION,
RC_DISPLAY_SHORTCUTS,
RC_MAKE_BACKUP,
RC_BACKUPDIR_PATH,
RC_RTL_SUPPORT,
RC_AUTO_NUMBER,
RC_MARK_FOREIGN_LANGUAGE,
RC_LANGUAGE_PACKAGE,
RC_LANGUAGE_AUTO_BEGIN,
RC_LANGUAGE_AUTO_END,
RC_LANGUAGE_COMMAND_BEGIN,
RC_LANGUAGE_COMMAND_END,
RC_DATE_INSERT_FORMAT,
RC_SHOW_BANNER,
RC_WHEEL_JUMP,
RC_CONVERTER,
RC_VIEWER,
RC_FORMAT,
RC_NEW_ASK_FILENAME,
RC_DEFAULT_LANGUAGE,
RC_LAST
};
static
keyword_item lyxrcTags[] = {
{ "\\accept_compound", RC_ACCEPT_COMPOUND },
{ "\\alternate_language", RC_ALT_LANG },
{ "\\ascii_linelen", RC_ASCII_LINELEN },
{ "\\ascii_roff_command", RC_ASCIIROFF_COMMAND },
{ "\\auto_number", RC_AUTO_NUMBER },
{ "\\auto_region_delete", RC_AUTOREGIONDELETE },
{ "\\autosave", RC_AUTOSAVE },
{ "\\backupdir_path", RC_BACKUPDIR_PATH },
{ "\\bind", RC_BIND },
{ "\\bind_file", RC_BINDFILE },
{ "\\check_lastfiles", RC_CHECKLASTFILES },
{ "\\chktex_command", RC_CHKTEX_COMMAND },
{ "\\converter", RC_CONVERTER },
{ "\\cursor_follows_scrollbar", RC_CURSOR_FOLLOWS_SCROLLBAR },
{ "\\custom_export_command", RC_CUSTOM_EXPORT_COMMAND },
{ "\\custom_export_format", RC_CUSTOM_EXPORT_FORMAT },
{ "\\date_insert_format", RC_DATE_INSERT_FORMAT },
{ "\\default_language", RC_DEFAULT_LANGUAGE },
{ "\\default_papersize", RC_DEFAULT_PAPERSIZE },
{ "\\display_shortcuts", RC_DISPLAY_SHORTCUTS },
{ "\\document_path", RC_DOCUMENTPATH },
{ "\\escape_chars", RC_ESC_CHARS },
{ "\\exit_confirmation", RC_EXIT_CONFIRMATION },
{ "\\fax_command", RC_FAX_COMMAND },
{ "\\fax_program", RC_FAXPROGRAM },
{ "\\font_encoding", RC_FONT_ENCODING },
{ "\\format", RC_FORMAT },
{ "\\input", RC_INPUT },
{ "\\kbmap", RC_KBMAP },
{ "\\kbmap_primary", RC_KBMAP_PRIMARY },
{ "\\kbmap_secondary", RC_KBMAP_SECONDARY },
{ "\\language_auto_begin", RC_LANGUAGE_AUTO_BEGIN },
{ "\\language_auto_end", RC_LANGUAGE_AUTO_END },
{ "\\language_command_begin", RC_LANGUAGE_COMMAND_BEGIN },
{ "\\language_command_end", RC_LANGUAGE_COMMAND_END },
{ "\\language_package", RC_LANGUAGE_PACKAGE },
{ "\\lastfiles", RC_LASTFILES },
{ "\\make_backup", RC_MAKE_BACKUP },
{ "\\mark_foreign_language", RC_MARK_FOREIGN_LANGUAGE },
{ "\\new_ask_filename", RC_NEW_ASK_FILENAME },
{ "\\num_lastfiles", RC_NUMLASTFILES },
{ "\\override_x_deadkeys", RC_OVERRIDE_X_DEADKEYS },
{ "\\personal_dictionary", RC_PERS_DICT },
{ "\\phone_book", RC_PHONEBOOK },
{ "\\print_adapt_output", RC_PRINT_ADAPTOUTPUT },
{ "\\print_collcopies_flag", RC_PRINTCOLLCOPIESFLAG },
{ "\\print_command", RC_PRINT_COMMAND },
{ "\\print_copies_flag", RC_PRINTCOPIESFLAG },
{ "\\print_evenpage_flag", RC_PRINTEVENPAGEFLAG },
{ "\\print_extra_options", RC_PRINTEXSTRAOPTIONS },
{ "\\print_file_extension", RC_PRINTFILEEXTENSION },
{ "\\print_landscape_flag", RC_PRINTLANDSCAPEFLAG },
{ "\\print_oddpage_flag", RC_PRINTODDPAGEFLAG },
{ "\\print_pagerange_flag", RC_PRINTPAGERANGEFLAG },
{ "\\print_paper_dimension_flag", RC_PRINTPAPERDIMENSIONFLAG },
{ "\\print_paper_flag", RC_PRINTPAPERFLAG },
{ "\\print_reverse_flag", RC_PRINTREVERSEFLAG },
{ "\\print_spool_command", RC_PRINTSPOOL_COMMAND },
{ "\\print_spool_printerprefix", RC_PRINTSPOOL_PRINTERPREFIX },
{ "\\print_to_file", RC_PRINTTOFILE },
{ "\\print_to_printer", RC_PRINTTOPRINTER },
{ "\\printer", RC_PRINTER },
{ "\\ps_command", RC_PS_COMMAND },
{ "\\rtl", RC_RTL_SUPPORT },
{ "\\screen_dpi", RC_SCREEN_DPI },
{ "\\screen_font_encoding", RC_SCREEN_FONT_ENCODING },
{ "\\screen_font_encoding_menu", RC_SCREEN_FONT_ENCODING_MENU },
{ "\\screen_font_menu", RC_SCREEN_FONT_MENU },
{ "\\screen_font_popup", RC_SCREEN_FONT_POPUP },
{ "\\screen_font_roman", RC_SCREEN_FONT_ROMAN },
{ "\\screen_font_sans", RC_SCREEN_FONT_SANS },
{ "\\screen_font_scalable", RC_SCREEN_FONT_SCALABLE },
{ "\\screen_font_sizes", RC_SCREEN_FONT_SIZES },
{ "\\screen_font_typewriter", RC_SCREEN_FONT_TYPEWRITER },
{ "\\screen_zoom", RC_SCREEN_ZOOM },
{ "\\serverpipe", RC_SERVERPIPE },
{ "\\set_color", RC_SET_COLOR },
{ "\\show_banner", RC_SHOW_BANNER },
{ "\\spell_command", RC_SPELL_COMMAND },
{ "\\tempdir_path", RC_TEMPDIRPATH },
{ "\\template_path", RC_TEMPLATEPATH },
{ "\\ui_file", RC_UIFILE },
{ "\\use_alt_language", RC_USE_ALT_LANG },
{ "\\use_escape_chars", RC_USE_ESC_CHARS },
{ "\\use_input_encoding", RC_USE_INP_ENC },
{ "\\use_personal_dictionary", RC_USE_PERS_DICT },
{ "\\use_tempdir", RC_USETEMPDIR },
{ "\\view_dvi_paper_option", RC_VIEWDVI_PAPEROPTION },
{ "\\viewer" ,RC_VIEWER},
{ "\\wheel_jump", RC_WHEEL_JUMP }
{ "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
{ "\\alternate_language", LyXRC::RC_ALT_LANG },
{ "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
{ "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
{ "\\auto_number", LyXRC::RC_AUTO_NUMBER },
{ "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
{ "\\autosave", LyXRC::RC_AUTOSAVE },
{ "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
{ "\\bind", LyXRC::RC_BIND },
{ "\\bind_file", LyXRC::RC_BINDFILE },
{ "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
{ "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
{ "\\converter", LyXRC::RC_CONVERTER },
{ "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
{ "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
{ "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
{ "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
{ "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
{ "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
{ "\\display_shortcuts", LyXRC::RC_DISPLAY_SHORTCUTS },
{ "\\document_path", LyXRC::RC_DOCUMENTPATH },
{ "\\escape_chars", LyXRC::RC_ESC_CHARS },
{ "\\exit_confirmation", LyXRC::RC_EXIT_CONFIRMATION },
{ "\\fax_command", LyXRC::RC_FAX_COMMAND },
{ "\\fax_program", LyXRC::RC_FAXPROGRAM },
{ "\\font_encoding", LyXRC::RC_FONT_ENCODING },
{ "\\format", LyXRC::RC_FORMAT },
{ "\\input", LyXRC::RC_INPUT },
{ "\\kbmap", LyXRC::RC_KBMAP },
{ "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
{ "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
{ "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
{ "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
{ "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
{ "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
{ "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
{ "\\lastfiles", LyXRC::RC_LASTFILES },
{ "\\make_backup", LyXRC::RC_MAKE_BACKUP },
{ "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
{ "\\new_ask_filename", LyXRC::RC_NEW_ASK_FILENAME },
{ "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
{ "\\override_x_deadkeys", LyXRC::RC_OVERRIDE_X_DEADKEYS },
{ "\\personal_dictionary", LyXRC::RC_PERS_DICT },
{ "\\phone_book", LyXRC::RC_PHONEBOOK },
{ "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
{ "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
{ "\\print_command", LyXRC::RC_PRINT_COMMAND },
{ "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
{ "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
{ "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
{ "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
{ "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
{ "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
{ "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
{ "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
{ "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
{ "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
{ "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
{ "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
{ "\\print_to_file", LyXRC::RC_PRINTTOFILE },
{ "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
{ "\\printer", LyXRC::RC_PRINTER },
{ "\\ps_command", LyXRC::RC_PS_COMMAND },
{ "\\rtl", LyXRC::RC_RTL_SUPPORT },
{ "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
{ "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
{ "\\screen_font_encoding_menu", LyXRC::RC_SCREEN_FONT_ENCODING_MENU },
{ "\\screen_font_menu", LyXRC::RC_SCREEN_FONT_MENU },
{ "\\screen_font_popup", LyXRC::RC_SCREEN_FONT_POPUP },
{ "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
{ "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
{ "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
{ "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
{ "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
{ "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
{ "\\serverpipe", LyXRC::RC_SERVERPIPE },
{ "\\set_color", LyXRC::RC_SET_COLOR },
{ "\\show_banner", LyXRC::RC_SHOW_BANNER },
{ "\\spell_command", LyXRC::RC_SPELL_COMMAND },
{ "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
{ "\\template_path", LyXRC::RC_TEMPLATEPATH },
{ "\\ui_file", LyXRC::RC_UIFILE },
{ "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
{ "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
{ "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
{ "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
{ "\\use_tempdir", LyXRC::RC_USETEMPDIR },
{ "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
{ "\\viewer" ,LyXRC::RC_VIEWER},
{ "\\wheel_jump", LyXRC::RC_WHEEL_JUMP }
};
/* Let the range depend of the size of lyxrcTags. Alejandro 240596 */
@ -1569,12 +1474,315 @@ void LyXRC::set_font_norm_type()
{
if (font_norm == "iso10646-1")
font_norm_type = ISO_10646_1;
else if (font_norm == "iso8859-1")
font_norm_type = ISO_8859_1;
else if (font_norm == "iso8859-6.8x")
font_norm_type = ISO_8859_6_8;
else if (font_norm == "iso8859-9")
font_norm_type = ISO_8859_9;
else
font_norm_type = OTHER_ENCODING;
}
string LyXRC::getFeedback(LyXRCTags tag)
{
string str;
switch( tag ) {
case RC_FONT_ENCODING:
str = N_("The font encoding used for the LaTeX2e fontenc package.\nT1 is highly recommended for non-English languages.");
break;
case RC_PRINTER:
str = N_("The default printer to print on. If none is specified, LyX will\nuse the environment variable PRINTER.");
break;
case RC_PRINT_COMMAND:
str = N_("Your favorite print program, eg \"dvips\", \"dvilj4\"");
break;
case RC_PRINTEVENPAGEFLAG:
case RC_PRINTODDPAGEFLAG:
case RC_PRINTPAGERANGEFLAG:
case RC_PRINTCOPIESFLAG:
case RC_PRINTCOLLCOPIESFLAG:
case RC_PRINTREVERSEFLAG:
case RC_PRINTLANDSCAPEFLAG:
case RC_PRINTPAPERFLAG:
case RC_PRINTPAPERDIMENSIONFLAG:
str = N_("Look at the man page for your favorite print program to learn\nwhich options to use.");
break;
case RC_PRINTTOPRINTER:
str = N_("Option to pass to the print program to print on a specific printer.");
break;
case RC_PRINT_ADAPTOUTPUT:
str = N_("Set to true for LyX to pass the name of the destination printer to your\nprint command.");
break;
case RC_PRINTTOFILE:
str = N_("Option to pass to the print program to print to a file.");
break;
case RC_PRINTFILEEXTENSION:
str = N_("Extension of printer program output file. Usually .ps");
break;
case RC_PRINTEXSTRAOPTIONS:
str = N_("Extra options to pass to printing program after everything else,\nbut before the filename of the DVI file to be printed.");
break;
case RC_PRINTSPOOL_COMMAND:
str = N_("When set, this printer option automatically prints to a file and then calls\na separate print spooling program on that file with the given name\nand arguments.");
break;
case RC_PRINTSPOOL_PRINTERPREFIX:
str = N_("If you specify a printer name in the print dialog, the following argument\nis prepended along with the printer name after the spool command.");
break;
case RC_SCREEN_DPI:
str = N_("DPI (dots per inch) of your monitor is auto-detected by LyX.\nIf that goes wrong, override the setting here.");
break;
case RC_SCREEN_ZOOM:
str = N_("The zoom percentage for screen fonts.\nA setting of 100% will make the fonts roughly the same size as on paper.");
break;
case RC_SCREEN_FONT_SIZES:
str = N_("The font sizes used for calculating the scaling of the screen fonts.");
break;
case RC_SCREEN_FONT_ROMAN:
case RC_SCREEN_FONT_SANS:
case RC_SCREEN_FONT_TYPEWRITER:
str = N_("The screen fonts used to display the text while editing.");
break;
case RC_SCREEN_FONT_MENU:
str = N_("The font for menus (and groups titles in popups).");
break;
case RC_SCREEN_FONT_POPUP:
str = N_("The font for popups.");
break;
case RC_SCREEN_FONT_ENCODING:
str = N_("The norm for the screen fonts.");
break;
case RC_SCREEN_FONT_ENCODING_MENU:
str = N_("The norm for the menu/popups fonts.");
break;
case RC_SET_COLOR:
break;
case RC_AUTOSAVE:
str = N_("The time interval between auto-saves (in seconds).\n0 means no auto-save");
break;
case RC_DOCUMENTPATH:
str = N_("The default path for your documents.");
break;
case RC_TEMPLATEPATH:
str = N_("The path that LyX will set when offering to choose a template.");
break;
case RC_TEMPDIRPATH:
str = N_("The path that LyX will use to store temporary TeX output.");
break;
case RC_USETEMPDIR:
str = N_("Specify to use a temporary directory to store temporary TeX output.\nThis directory is deleted when you quit LyX.");
break;
case RC_LASTFILES:
str = N_("The file where the last-files information should be stored.");
break;
case RC_AUTOREGIONDELETE:
str = N_("Set to false if you don't want the current selection to be replaced\nautomatically by what you type.");
break;
case RC_OVERRIDE_X_DEADKEYS:
str = N_("Set to true for LyX to take over the handling of the dead keys\n(a.k.a accent keys) that may be defined for your keyboard.");
break;
case RC_SERVERPIPE:
str = N_("This starts the lyxserver. The pipes get an additional extension\n\".in\" and \".out\". Only for advanced users.");
break;
case RC_BINDFILE:
str = N_("Keybindings file. Can either specify an absolute path,\nor LyX will look in its global and local bind/ directories.");
break;
case RC_UIFILE:
str = N_("The UI (user interface) file. Can either specify an absolute path,\nor LyX will look in its global and local ui/ directories.");
break;
case RC_KBMAP:
case RC_KBMAP_PRIMARY:
case RC_KBMAP_SECONDARY:
str = N_("Use this to set the correct mapping file for your keyboard.\nYou'll need this if you for instance want to type German documents\non an American keyboard.");
break;
case RC_FAX_COMMAND:
break;
case RC_PHONEBOOK:
break;
case RC_FAXPROGRAM:
break;
case RC_ASCIIROFF_COMMAND:
str = N_("Use to define an external program to render tables in the ASCII output.\nE.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file.\nIf \"none\" is specified, an internal routine is used.");
break;
case RC_ASCII_LINELEN:
str = N_("This is the maximum line length of an exported ASCII file\n(LaTeX, SGML or plain text).");
break;
case RC_NUMLASTFILES:
str = N_("Maximal number of lastfiles. Up to 9 can appear in the file menu.");
break;
case RC_CHECKLASTFILES:
str = N_("Specify to check whether the lastfiles still exist.");
break;
case RC_VIEWDVI_PAPEROPTION:
break;
case RC_DEFAULT_PAPERSIZE:
str = N_("Specify the default paper size.");
break;
case RC_PS_COMMAND:
break;
case RC_ACCEPT_COMPOUND:
str = N_("Consider run-together words, such as \"notthe\" for \"not the\",\nas legal words?");
break;
case RC_SPELL_COMMAND:
str = N_("What command runs the spell checker?");
break;
case RC_USE_INP_ENC:
str = N_("Specify whether to pass the -T input encoding option to ispell.\nEnable this if you can't spellcheck words with international letters\nin them.\nThis may not work with all dictionaries.");
break;
case RC_USE_ALT_LANG:
case RC_ALT_LANG:
str = N_("Specify an alternate language.\nThe default is to use the language of the document.");
break;
case RC_USE_PERS_DICT:
case RC_PERS_DICT:
str = N_("Specify an alternate personal dictionary file.\nE.g. \".ispell_english\".");
break;
case RC_USE_ESC_CHARS:
case RC_ESC_CHARS:
str = N_("Specify additional chars that can be part of a word.");
break;
case RC_SCREEN_FONT_SCALABLE:
str = N_("Allow the use of scalable screen fonts? If false, LyX will use the\nclosest existing size for a match. Use this if the scalable fonts\nlook bad and you have many fixed size fonts.");
break;
case RC_CHKTEX_COMMAND:
str = N_("Define how to run chktex.\nE.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\"\nRefer to the ChkTeX documentation.");
break;
case RC_CURSOR_FOLLOWS_SCROLLBAR:
str = N_("LyX normally doesn't update the cursor position if you move the scrollbar.\nSet to true if you'd prefer to always have the cursor on screen.");
break;
case RC_EXIT_CONFIRMATION:
str = N_("Sets whether LyX asks for a second confirmation to exit when you have\nchanged documents.\n(LyX will still ask to save changed documents.)");
break;
case RC_DISPLAY_SHORTCUTS:
str = N_("LyX continously displays names of last command executed,\nalong with a list of defined short-cuts for it in the minibuffer.\nSet to false if LyX seems slow.");
break;
case RC_MAKE_BACKUP:
str = N_("Set to false if you don't want LyX to create backup files.");
break;
case RC_BACKUPDIR_PATH:
str = N_("The path for storing backup files. If it is an empty string,\nLyX will store the backup file in the same directory as the original file.");
break;
case RC_RTL_SUPPORT:
str = N_("Use to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
break;
case RC_MARK_FOREIGN_LANGUAGE:
str = N_("Use to control the highlighting of words with a language foreign to\nthat of the document.");
break;
case RC_LANGUAGE_PACKAGE:
str = N_("The latex command for loading the language package.\nE.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
break;
case RC_LANGUAGE_AUTO_BEGIN:
str = N_("Use if a language switching command is needed at the beginning\nof the document.");
break;
case RC_LANGUAGE_AUTO_END:
str = N_("Use if a language switching command is needed at the end\nof the document.");
break;
case RC_LANGUAGE_COMMAND_BEGIN:
str = N_("The latex command for changing from the language of the document\nto another language.\nE.g. \\selectlanguage{$$lang} where $$lang is substituted by the name\nof the second language.");
break;
case RC_LANGUAGE_COMMAND_END:
str = N_("The latex command for changing back to the language of the document.");
break;
case RC_DATE_INSERT_FORMAT:
str = N_("This accepts the normal strftime formats; see man strftime for full details.\nE.g.\"%A, %e. %B %Y\".");
break;
case RC_SHOW_BANNER:
str = N_("Set to false if you don't want the startup banner.");
break;
case RC_WHEEL_JUMP:
str = N_("The wheel movement factor (for mice with wheels or five button mice)");
break;
case RC_CONVERTER:
break;
case RC_VIEWER:
break;
case RC_FORMAT:
break;
case RC_NEW_ASK_FILENAME:
str = N_("This sets the behaviour if you want to be asked for a filename when\ncreating a new document or wait until you save it and be asked then.");
break;
case RC_DEFAULT_LANGUAGE:
str = N_("New documents will be assigned this language.");
break;
default:
break;
}
return str;
}
// The global instance
LyXRC lyxrc;

View File

@ -25,6 +25,101 @@ class LyXRC //: public noncopyable {
// noncopyable again. For now I want to minimise changes. ARRae 20001010
{
public:
enum LyXRCTags {
RC_FONT_ENCODING = 1,
RC_PRINTER,
RC_PRINT_COMMAND,
RC_PRINTEVENPAGEFLAG,
RC_PRINTODDPAGEFLAG,
RC_PRINTPAGERANGEFLAG,
RC_PRINTCOPIESFLAG,
RC_PRINTCOLLCOPIESFLAG,
RC_PRINTREVERSEFLAG,
RC_PRINTLANDSCAPEFLAG,
RC_PRINTTOPRINTER,
RC_PRINT_ADAPTOUTPUT,
RC_PRINTTOFILE,
RC_PRINTFILEEXTENSION,
RC_PRINTEXSTRAOPTIONS,
RC_PRINTSPOOL_COMMAND,
RC_PRINTSPOOL_PRINTERPREFIX,
RC_PRINTPAPERFLAG,
RC_PRINTPAPERDIMENSIONFLAG,
RC_CUSTOM_EXPORT_COMMAND,
RC_CUSTOM_EXPORT_FORMAT,
RC_SCREEN_DPI,
RC_SCREEN_ZOOM,
RC_SCREEN_FONT_SIZES,
RC_SCREEN_FONT_ROMAN,
RC_SCREEN_FONT_SANS,
RC_SCREEN_FONT_TYPEWRITER,
RC_SCREEN_FONT_MENU,
RC_SCREEN_FONT_POPUP,
RC_SCREEN_FONT_ENCODING,
RC_SCREEN_FONT_ENCODING_MENU,
RC_SET_COLOR,
RC_AUTOSAVE,
RC_DOCUMENTPATH,
RC_TEMPLATEPATH,
RC_TEMPDIRPATH,
RC_USETEMPDIR,
RC_LASTFILES,
RC_AUTOREGIONDELETE,
RC_BIND,
RC_OVERRIDE_X_DEADKEYS,
RC_SERVERPIPE,
RC_INPUT,
RC_BINDFILE,
RC_UIFILE,
RC_KBMAP,
RC_KBMAP_PRIMARY,
RC_KBMAP_SECONDARY,
RC_FAX_COMMAND,
RC_PHONEBOOK,
RC_FAXPROGRAM,
RC_ASCIIROFF_COMMAND,
RC_ASCII_LINELEN,
RC_NUMLASTFILES,
RC_CHECKLASTFILES,
RC_VIEWDVI_PAPEROPTION,
RC_DEFAULT_PAPERSIZE,
RC_PS_COMMAND,
RC_ACCEPT_COMPOUND,
RC_SPELL_COMMAND,
RC_USE_INP_ENC,
RC_USE_ALT_LANG,
RC_USE_PERS_DICT,
RC_USE_ESC_CHARS,
RC_SCREEN_FONT_SCALABLE,
RC_ALT_LANG,
RC_PERS_DICT,
RC_ESC_CHARS,
RC_CHKTEX_COMMAND,
RC_CURSOR_FOLLOWS_SCROLLBAR,
RC_EXIT_CONFIRMATION,
RC_DISPLAY_SHORTCUTS,
RC_MAKE_BACKUP,
RC_BACKUPDIR_PATH,
RC_RTL_SUPPORT,
RC_AUTO_NUMBER,
RC_MARK_FOREIGN_LANGUAGE,
RC_LANGUAGE_PACKAGE,
RC_LANGUAGE_AUTO_BEGIN,
RC_LANGUAGE_AUTO_END,
RC_LANGUAGE_COMMAND_BEGIN,
RC_LANGUAGE_COMMAND_END,
RC_DATE_INSERT_FORMAT,
RC_SHOW_BANNER,
RC_WHEEL_JUMP,
RC_CONVERTER,
RC_VIEWER,
RC_FORMAT,
RC_NEW_ASK_FILENAME,
RC_DEFAULT_LANGUAGE,
RC_LAST
};
///
LyXRC();
///
@ -42,6 +137,8 @@ public:
///
int ReadBindFile(string const & name = "cua");
///
static string getFeedback( LyXRCTags );
///
string bind_file;
///
string ui_file;
@ -146,8 +243,12 @@ public:
///
ISO_10646_1,
///
ISO_8859_1,
///
ISO_8859_6_8,
///
ISO_8859_9,
///
OTHER_ENCODING
};
///

View File

@ -86,7 +86,15 @@ string const tostr(bool const & b)
{
return (b ? "true" : "false");
}
///
template<>
inline
string const tostr(string const & s)
{
return s;
}
/// Does the string start with this prefix?
bool prefixIs(string const &, char const *);

View File

@ -148,14 +148,12 @@ LyXTabular * LyXTabular::Clone(InsetTabular * inset)
/* activates all lines and sets all widths to 0 */
void LyXTabular::Init(int rows_arg, int columns_arg)
{
rows_ = rows_arg;
columns_ = columns_arg;
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;
for (int i = 0; i < rows_; ++i) {
for (int j = 0; j < columns_; ++j) {
@ -163,17 +161,14 @@ void LyXTabular::Init(int rows_arg, int columns_arg)
cell_info[i][j].inset.SetDrawFrame(0, InsetText::LOCKED);
cell_info[i][j].cellno = cellno++;
}
cell_info[i][columns_-1].right_line = true;
cell_info[i].back().right_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 (int i = 0; i < columns_; ++i) {
calculate_width_of_column(i);
}
//column_info[columns_ - 1].right_line = true;
column_info.back().right_line = true;
calculate_width_of_tabular();
@ -246,7 +241,7 @@ void LyXTabular::AppendColumn(int cell)
cell_vvector c_info = cell_vvector(rows_, cell_vector(columns_,
cellstruct()));
int column = column_of_cell(cell);
int const column = column_of_cell(cell);
column_vector::iterator cit = column_info.begin() + column + 1;
column_info.insert(cit, columnstruct());
@ -267,9 +262,10 @@ void LyXTabular::AppendColumn(int cell)
}
}
cell_info = c_info;
++column;
//++column;
for (int i = 0; i < rows_; ++i) {
cell_info[i][column].inset.clear();
//cell_info[i][column].inset.clear();
cell_info[i][column + 1].inset.clear();
}
Reinit();
}
@ -293,7 +289,6 @@ void LyXTabular::DeleteColumn(int column)
void LyXTabular::Reinit()
{
// Jürgen, use iterators.
for (int i = 0; i < rows_; ++i) {
for (int j = 0; j < columns_; ++j) {
cell_info[i][j].width_of_cell = 0;
@ -312,12 +307,12 @@ void LyXTabular::Reinit()
void LyXTabular::set_row_column_number_info(bool oldformat)
{
int c = 0;
int column = 0;
//int c = 0;
//int column = 0;
numberofcells = -1;
int row = 0;
for (; row < rows_; ++row) {
for (column = 0; column<columns_; ++column) {
//int row = 0;
for (int row = 0; row < rows_; ++row) {
for (int column = 0; column<columns_; ++column) {
if (cell_info[row][column].multicolumn
!= LyXTabular::CELL_PART_OF_MULTICOLUMN)
++numberofcells;
@ -325,12 +320,15 @@ void LyXTabular::set_row_column_number_info(bool oldformat)
}
}
++numberofcells; // because this is one more than as we start from 0
row = 0;
column = 0;
rowofcell.resize(numberofcells);
columnofcell.resize(numberofcells);
rowofcell.resize(numberofcells);
columnofcell.resize(numberofcells);
#if 0
int row = 0;
int column = 0;
int c = 0;
while (c < numberofcells && row < rows_ && column < columns_) {
rowofcell[c] = row;
columnofcell[c] = column;
@ -345,8 +343,27 @@ void LyXTabular::set_row_column_number_info(bool oldformat)
++row;
}
}
for (row = 0; row < rows_; ++row) {
for (column = 0; column<columns_; ++column) {
#else
// Isn't this the same as the while above? (Lgb)
for (int row = 0, column = 0, c = 0;
c < numberofcells && row < rows_ && column < columns_;) {
rowofcell[c] = row;
columnofcell[c] = column;
++c;
do {
++column;
} while (column < columns_ &&
cell_info[row][column].multicolumn
== LyXTabular::CELL_PART_OF_MULTICOLUMN);
if (column == columns_) {
column = 0;
++row;
}
}
#endif
for (int row = 0; row < rows_; ++row) {
for (int column = 0; column < columns_; ++column) {
if (IsPartOfMultiColumn(row,column))
continue;
// now set the right line of multicolumns right for oldformat read
@ -517,8 +534,7 @@ int LyXTabular::GetWidthOfColumn(int cell) const
int const column1 = column_of_cell(cell);
int const column2 = right_column_of_cell(cell);
int result = 0;
int i = column1;
for (; i <= column2; ++i) {
for (int i = column1; i <= column2; ++i) {
result += column_info[i].width_of_column;
}
return result;
@ -542,15 +558,14 @@ bool LyXTabular::SetWidthOfMulticolCell(int cell, int new_width)
int const column2 = right_column_of_cell(cell);
// first set columns to 0 so we can calculate the right width
int i = column1;
for (; i <= column2; ++i) {
for (int i = column1; i <= column2; ++i) {
cell_info[row][i].width_of_cell = 0;
}
// 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) {
int i = column1;
for (; 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;
}
@ -738,7 +753,8 @@ LyXAlignment LyXTabular::GetAlignment(int cell, bool onlycolumn) const
}
LyXTabular::VAlignment LyXTabular::GetVAlignment(int cell, bool onlycolumn) const
LyXTabular::VAlignment
LyXTabular::GetVAlignment(int cell, bool onlycolumn) const
{
if (!onlycolumn && IsMultiColumn(cell))
return cellinfo_of_cell(cell)->valignment;
@ -883,7 +899,7 @@ void LyXTabular::calculate_width_of_tabular()
int LyXTabular::row_of_cell(int cell) const
{
if (cell >= numberofcells)
return rows_-1;
return rows_ - 1;
else if (cell < 0)
return 0;
return rowofcell[cell];
@ -893,7 +909,7 @@ int LyXTabular::row_of_cell(int cell) const
int LyXTabular::column_of_cell(int cell) const
{
if (cell >= numberofcells)
return columns_-1;
return columns_ - 1;
else if (cell < 0)
return 0;
return columnofcell[cell];
@ -905,82 +921,102 @@ int LyXTabular::right_column_of_cell(int cell) const
int const row = row_of_cell(cell);
int column = column_of_cell(cell);
while (column < (columns_ - 1) &&
cell_info[row][column+1].multicolumn == LyXTabular::CELL_PART_OF_MULTICOLUMN)
cell_info[row][column + 1].multicolumn == LyXTabular::CELL_PART_OF_MULTICOLUMN)
++column;
return column;
}
const string write_attribute(const string name, const int value)
// Perfect case for a template... (Lgb)
#if 1
template<class T>
string const write_attribute(string const & name, T const & t)
{
string str = " " + name + "=\"" + tostr(t) + "\"";
return str;
}
template <>
string const write_attribute(string const & name, bool const & b)
{
return write_attribute(name, int(b));
}
#else
string const write_attribute(string const & name, int value)
{
string str = " " + name + "=\"" + tostr(value) + "\"";
return str;
}
const string write_attribute(string name, const string & value)
string const write_attribute(string const & name, string const & value)
{
string str = " " + name + "=\"" + value + "\"";
return str;
}
const string write_attribute(string name, const bool value)
string const write_attribute(string const & name, bool value)
{
string str = " " + name + "=\"" + tostr((int)value) + "\"";
return str;
}
#endif
void LyXTabular::Write(Buffer const * buf, ostream & os) const
{
// header line
os << "<LyXTabular" <<
write_attribute("version", 1) <<
write_attribute("rows", rows_) <<
write_attribute("columns", columns_) <<
">\n";
os << "<LyXTabular"
<< write_attribute("version", 1)
<< write_attribute("rows", rows_)
<< write_attribute("columns", columns_)
<< ">\n";
// global longtable options
os << "<Features" <<
write_attribute("rotate", rotate) <<
write_attribute("islongtable", is_long_tabular) <<
write_attribute("endhead", endhead) <<
write_attribute("endfirsthead", endfirsthead) <<
write_attribute("endfoot", endfoot) <<
write_attribute("endlastfoot", endlastfoot) <<
">\n\n";
os << "<Features"
<< write_attribute("rotate", rotate)
<< write_attribute("islongtable", is_long_tabular)
<< write_attribute("endhead", endhead)
<< write_attribute("endfirsthead", endfirsthead)
<< write_attribute("endfoot", endfoot)
<< write_attribute("endlastfoot", endlastfoot)
<< ">\n\n";
for (int i = 0; i < rows_; ++i) {
os << "<Row" <<
write_attribute("topline", row_info[i].top_line) <<
write_attribute("bottomline", row_info[i].bottom_line) <<
write_attribute("newpage", row_info[i].newpage) <<
">\n";
os << "<Row"
<< write_attribute("topline", row_info[i].top_line)
<< write_attribute("bottomline", row_info[i].bottom_line)
<< write_attribute("newpage", row_info[i].newpage)
<< ">\n";
for (int j = 0; j < columns_; ++j) {
if (!i) {
os << "<Column" <<
write_attribute("alignment", column_info[j].alignment) <<
write_attribute("valignment", column_info[j].valignment) <<
write_attribute("leftline", column_info[j].left_line) <<
write_attribute("rightline", column_info[j].right_line) <<
write_attribute("width", VSpace(column_info[j].p_width).asLyXCommand()) <<
write_attribute("special", column_info[j].align_special) <<
">\n";
os << "<Column"
<< write_attribute("alignment", column_info[j].alignment)
<< write_attribute("valignment", column_info[j].valignment)
<< write_attribute("leftline", column_info[j].left_line)
<< write_attribute("rightline", column_info[j].right_line)
<< write_attribute("width",
VSpace(column_info[j].p_width)
.asLyXCommand())
<< write_attribute("special", column_info[j].align_special)
<< ">\n";
} else {
os << "<Column>\n";
}
os << "<Cell" <<
write_attribute("multicolumn", cell_info[i][j].multicolumn) <<
write_attribute("alignment", cell_info[i][j].alignment) <<
write_attribute("valignment", cell_info[i][j].valignment) <<
write_attribute("topline", cell_info[i][j].top_line) <<
write_attribute("bottomline", cell_info[i][j].bottom_line) <<
write_attribute("leftline", cell_info[i][j].left_line) <<
write_attribute("rightline", cell_info[i][j].right_line) <<
write_attribute("rotate", cell_info[i][j].rotate) <<
write_attribute("usebox", (int)cell_info[i][j].usebox) <<
write_attribute("width", cell_info[i][j].p_width) <<
write_attribute("special", cell_info[i][j].align_special) <<
">\n";
os << "<Cell"
<< write_attribute("multicolumn", cell_info[i][j].multicolumn)
<< write_attribute("alignment", cell_info[i][j].alignment)
<< write_attribute("valignment", cell_info[i][j].valignment)
<< write_attribute("topline", cell_info[i][j].top_line)
<< write_attribute("bottomline", cell_info[i][j].bottom_line)
<< write_attribute("leftline", cell_info[i][j].left_line)
<< write_attribute("rightline", cell_info[i][j].right_line)
<< write_attribute("rotate", cell_info[i][j].rotate)
<< write_attribute("usebox", cell_info[i][j].usebox)
<< write_attribute("width", cell_info[i][j].p_width)
<< write_attribute("special", cell_info[i][j].align_special)
<< ">\n";
os << "\\begin_inset ";
cell_info[i][j].inset.Write(buf, os);
os << "\n\\end_inset \n"
@ -994,21 +1030,21 @@ void LyXTabular::Write(Buffer const * buf, ostream & os) const
static
bool getTokenValue(string const str, const char * token, string & ret)
bool getTokenValue(string const & str, const char * token, string & ret)
{
int pos = str.find(token);
char ch = str[pos+strlen(token)];
string::size_type pos = str.find(token);
char ch = str[pos + strlen(token)];
if ((pos < 0) || (ch != '='))
if ((pos == string::npos) || (ch != '='))
return false;
ret.erase();
pos += strlen(token)+1;
pos += strlen(token) + 1;
ch = str[pos];
if ((ch != '"') && (ch != '\'')) { // only read till next space
ret += ch;
ch = ' ';
}
while((pos < int(str.length()-1)) && (str[++pos] != ch))
while((pos < str.length() - 1) && (str[++pos] != ch))
ret += str[pos];
return true;
@ -1016,16 +1052,15 @@ bool getTokenValue(string const str, const char * token, string & ret)
static
bool getTokenValue(string const str, const char * token, int & num)
bool getTokenValue(string const & str, const char * token, int & num)
{
int pos = str.find(token);
char ch = str[pos+strlen(token)];
string::size_type pos = str.find(token);
char ch = str[pos + strlen(token)];
if ((pos < 0) || (ch != '='))
if ((pos == string::npos) || (ch != '='))
return false;
string ret;
//ret.erase(); // why? (Lgb)
pos += strlen(token)+1;
pos += strlen(token) + 1;
ch = str[pos];
if ((ch != '"') && (ch != '\'')) { // only read till next space
if (!isdigit(ch))
@ -1033,7 +1068,7 @@ bool getTokenValue(string const str, const char * token, int & num)
ret += ch;
}
++pos;
while((pos < int(str.length()-1)) && isdigit(str[pos]))
while((pos < str.length() - 1) && isdigit(str[pos]))
ret += str[pos++];
num = strToInt(ret);
@ -1042,28 +1077,28 @@ bool getTokenValue(string const str, const char * token, int & num)
static
bool getTokenValue(string const str, const char * token, LyXAlignment & num)
bool getTokenValue(string const & str, const char * token, LyXAlignment & num)
{
int tmp;
bool ret = getTokenValue(str, token, tmp);
bool const ret = getTokenValue(str, token, tmp);
num = static_cast<LyXAlignment>(tmp);
return ret;
}
static
bool getTokenValue(string const str, const char * token,
bool getTokenValue(string const & str, const char * token,
LyXTabular::VAlignment & num)
{
int tmp;
bool ret = getTokenValue(str, token, tmp);
bool const ret = getTokenValue(str, token, tmp);
num = static_cast<LyXTabular::VAlignment>(tmp);
return ret;
}
static
bool getTokenValue(string const str, const char * token,
bool getTokenValue(string const & str, const char * token,
LyXTabular::BoxType & num)
{
int tmp;
@ -1074,16 +1109,15 @@ bool getTokenValue(string const str, const char * token,
static
bool getTokenValue(string const str, const char * token, bool & flag)
bool getTokenValue(string const & str, const char * token, bool & flag)
{
int pos = str.find(token);
char ch = str[pos+strlen(token)];
string::size_type pos = str.find(token);
char ch = str[pos + strlen(token)];
if ((pos < 0) || (ch != '='))
if ((pos == string::npos) || (ch != '='))
return false;
string ret;
//ret.erase(); // Why? (Lgb)
pos += strlen(token)+1;
pos += strlen(token) + 1;
ch = str[pos];
if ((ch != '"') && (ch != '\'')) { // only read till next space
if (!isdigit(ch))
@ -1091,7 +1125,7 @@ bool getTokenValue(string const str, const char * token, bool & flag)
ret += ch;
}
++pos;
while((pos < int(str.length()-1)) && isdigit(str[pos]))
while((pos < str.length() - 1) && isdigit(str[pos]))
ret += str[pos++];
flag = strToInt(ret);
@ -1140,8 +1174,8 @@ void LyXTabular::Read(Buffer const * buf, LyXLex & lex)
getTokenValue(line, "endfirsthead", endfirsthead);
getTokenValue(line, "endfoot", endfoot);
getTokenValue(line, "endlastfoot", endlastfoot);
int i, j;
for(i = 0; i < rows_; ++i) {
for(int i = 0; i < rows_; ++i) {
l_getline(is, line);
if (!prefixIs(line, "<Row ")) {
lyxerr << "Wrong tabular format (expected <Row ...> got" <<
@ -1151,7 +1185,7 @@ void LyXTabular::Read(Buffer const * buf, LyXLex & lex)
getTokenValue(line, "topline", row_info[i].top_line);
getTokenValue(line, "bottomline", row_info[i].bottom_line);
getTokenValue(line, "newpage", row_info[i].newpage);
for (j = 0; j < columns_; ++j) {
for (int j = 0; j < columns_; ++j) {
l_getline(is,line);
if (!prefixIs(line,"<Column")) {
lyxerr << "Wrong tabular format (expected <Column ...> got" <<
@ -1923,7 +1957,7 @@ bool LyXTabular::IsPartOfMultiColumn(int row, int column) const
{
if ((row >= rows_) || (column >= columns_))
return false;
return (cell_info[row][column].multicolumn==CELL_PART_OF_MULTICOLUMN);
return (cell_info[row][column].multicolumn == CELL_PART_OF_MULTICOLUMN);
}
@ -1952,7 +1986,7 @@ int LyXTabular::TeXTopHLine(ostream & os, int row) const
} else {
return 0;
}
os << endl;
os << "\n";
return 1;
}
@ -1982,7 +2016,7 @@ int LyXTabular::TeXBottomHLine(ostream & os, int row) const
} else {
return 0;
}
os << endl;
os << "\n";
return 1;
}
@ -1992,7 +2026,7 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
int ret = 0;
if (GetRotateCell(cell)) {
os << "\\begin{sideways}" << endl;
os << "\\begin{sideways}\n";
++ret;
}
if (IsMultiColumn(cell)) {
@ -2103,7 +2137,7 @@ int LyXTabular::Latex(Buffer const * buf,
//+---------------------------------------------------------------------
if (rotate) {
os << "\\begin{sideways}" << endl;
os << "\\begin{sideways}\n";
++ret;
}
if (is_long_tabular)
@ -2146,17 +2180,17 @@ int LyXTabular::Latex(Buffer const * buf,
if (column_info[i].right_line)
os << '|';
}
os << "}" << endl;
os << "}\n";
++ret;
//+---------------------------------------------------------------------
//+ the single row and columns (cells) +
//+---------------------------------------------------------------------
int bret;
//int bret;
for(int i = 0; i < rows_; ++i) {
ret += TeXTopHLine(os, i);
bret = ret;
int bret = ret;
if (IsLongTabular()) {
if ((endhead < 0) && (i == (abs(endhead)-1))) {
os << "\\endhead\n";
@ -2187,12 +2221,12 @@ int LyXTabular::Latex(Buffer const * buf,
ret += GetCellInset(cell)->Latex(buf, os, fragile, fp);
ret += TeXCellPostamble(os, cell);
if (!IsLastCellInRow(cell)) { // not last cell in row
os << "&" << endl;
os << "&\n";
++ret;
}
++cell;
}
os << "\\\\" << endl;
os << "\\\\\n";
ret += TeXBottomHLine(os, i);
bret = ret;
if (IsLongTabular()) {
@ -2241,14 +2275,13 @@ int LyXTabular::Latex(Buffer const * buf,
int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
{
int ret = 0;
int cell = 0;
//+---------------------------------------------------------------------
//+ first the opening preamble +
//+---------------------------------------------------------------------
os << "<tgroup cols=\"" << columns_
<< "\" colsep=\"1\" rowsep=\"1\">" << endl;
<< "\" colsep=\"1\" rowsep=\"1\">\n";
for (int i = 0; i < columns_; ++i) {
os << "<colspec colname=\"col" << i << "\" align=\"";
@ -2263,7 +2296,7 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
os << "center";
break;
}
os << "\"/>" << endl;
os << "\"/>\n";
++ret;
}
@ -2271,11 +2304,12 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
//+ the single row and columns (cells) +
//+---------------------------------------------------------------------
os << "<tbody>" << endl;
int cell = 0;
os << "<tbody>\n";
for(int i = 0; i < rows_; ++i) {
os << "<row>" << endl;
os << "<row>\n";
for(int j = 0; j < columns_; ++j) {
if (IsPartOfMultiColumn(i,j))
if (IsPartOfMultiColumn(i, j))
continue;
os << "<entry align=\"";
@ -2314,9 +2348,9 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
os << "</entry>";
++cell;
}
os << "</row>" << endl;
os << "</row>\n";
}
os << "</tbody>" << endl;
os << "</tbody>\n";
//+---------------------------------------------------------------------
//+ the closing of the tabular +
//+---------------------------------------------------------------------
@ -2328,20 +2362,29 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
}
static void print_n_chars(ostream & os, unsigned char ch, int const n)
static
inline
void print_n_chars(ostream & os, unsigned char ch, int n)
{
for(int i=0; i < n; ++i)
os << ch;
#if 0
for(int i = 0; i < n; ++i)
os << ch;
#else
os << string(n, ch);
#endif
}
int LyXTabular::AsciiTopHLine(ostream & os, int row,
vector<unsigned int> const & clen) const
{
int const fcell = GetFirstCellInRow(row);
int const n = NumberOfCellsInRow(fcell) + fcell;
int len;
int column = 0;
unsigned char ch;
//int len;
//int column = 0;
//unsigned char ch;
#if 0
int tmp = 0;
for (int i = fcell; i < n; ++i) {
@ -2350,7 +2393,15 @@ int LyXTabular::AsciiTopHLine(ostream & os, int row,
}
if (!tmp)
return 0;
#else
// Isn't this equivalent? (Lgb)
for (int i = fcell; i < n; ++i) {
if (TopLine(i))
return 0;
}
#endif
unsigned char ch;
for (int i = fcell; i < n; ++i) {
if (TopLine(i)) {
if (LeftLine(i))
@ -2362,8 +2413,8 @@ int LyXTabular::AsciiTopHLine(ostream & os, int row,
os << " ";
ch = ' ';
}
column = column_of_cell(i);
len = clen[column];
int column = column_of_cell(i);
int len = clen[column];
while(IsPartOfMultiColumn(row, ++column))
len += clen[column] + 4;
print_n_chars(os, ch, len);
@ -2386,9 +2437,10 @@ int LyXTabular::AsciiBottomHLine(ostream & os, int row,
{
int const fcell = GetFirstCellInRow(row);
int const n = NumberOfCellsInRow(fcell) + fcell;
int len;
int column = 0;
unsigned char ch;
//int len;
//int column = 0;
//unsigned char ch;
#if 0
int tmp = 0;
for (int i = fcell; i < n; ++i) {
@ -2397,7 +2449,14 @@ int LyXTabular::AsciiBottomHLine(ostream & os, int row,
}
if (!tmp)
return 0;
#else
// Isn't this equivalent? (Lgb)
for (int i = fcell; i < n; ++i) {
if (BottomLine(i))
return 0;
}
#endif
unsigned char ch;
for (int i = fcell; i < n; ++i) {
if (BottomLine(i)) {
if (LeftLine(i))
@ -2409,8 +2468,8 @@ int LyXTabular::AsciiBottomHLine(ostream & os, int row,
os << " ";
ch = ' ';
}
column = column_of_cell(i);
len = clen[column];
int column = column_of_cell(i);
int len = clen[column];
while(IsPartOfMultiColumn(row, ++column))
len += clen[column] + 4;
print_n_chars(os, ch, len);

View File

@ -48,8 +48,7 @@ string const DefaultTrans::process(char c, TransManager & k)
Trans::Trans()
{
int i = 0;
for(i = 0; i < TEX_MAX_ACCENT + 1; ++i)
for(int i = 0; i < TEX_MAX_ACCENT + 1; ++i)
kmod_list_[i] = 0;
}
@ -90,7 +89,6 @@ void Trans::FreeKeymap()
{
for(int i = 0; i < 256; ++i)
if (!keymap_[i].empty()) {
//delete keymap_[i];
keymap_[i].erase();
}
for(int i = 0; i < TEX_MAX_ACCENT + 1; ++i)
@ -114,7 +112,7 @@ string const & Trans::GetName() const
}
enum _kmaptags {
enum kmaptags_ {
KCOMB = 1,
KMOD,
KMAP,
@ -153,15 +151,31 @@ void Trans::AddDeadkey(tex_accent accent, string const & keys,
}
for(string::size_type i = 0; i < keys.length(); ++i) {
#if 0
string * temp =
&keymap_[static_cast<unsigned char>(keys[i])];
#warning this is not really clean we should find a cleaner way (Jug)
*temp = "xx"; /* this is needed for the being sure that the below
assignment is not assigned to a nullpointer
(if size of string = 0)
*temp = "xx"; /* this is needed for the being sure that
the below assignment is not assigned to
a nullpointer (if size of string = 0)
*/
(*temp)[0] = 0;
(*temp)[1] = accent;
(*temp)[1] = accent;
#else
string & temp =
keymap_[static_cast<unsigned char>(keys[i])];
if (!temp.empty()) {
temp[0] = 0;
temp[1] = accent;
} else {
// But the question remains: "Should we be allowed
// to change bindings, without unbinding first?"
// Lgb
lyxerr << "Hey... keymap_[xx] not empty." << endl;
temp.push_back(0);
temp.push_back(accent);
}
#endif
}
kmod_list_[accent]->exception_list = 0;
}