From 3df345c9383480f68fad51feae8b9c64425c8729 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 11 Apr 2000 16:57:16 +0000 Subject: [PATCH] Small changes; ChangeLog is your friend git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@648 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 41 +++++++++++++++++++++++++++++------ src/buffer.C | 4 ++-- src/insets/insetlatexaccent.C | 2 +- src/lyx_gui_misc.C | 8 +++++++ src/lyx_gui_misc.h | 3 +++ src/lyx_main.C | 5 +---- src/lyxlex_pimpl.C | 2 +- src/lyxserver.C | 3 ++- src/menus.C | 39 ++++++++++++++++++--------------- src/support/DebugStream.h | 8 +++++++ src/tex-strings.C | 4 ++-- 11 files changed, 84 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8f19193e6..c4f3add827 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,42 @@ +2000-04-11 Jean-Marc Lasgouttes + + * src/lyxserver.C (callback): fix dispatch of functions + + * src/insets/insetlatexaccent.C (checkContents): turn bogus + printf() into lyxerr call. + + * src/tex-strings.C (tex_fonts): add "pslatex" to the choice of + fonts. + + * src/menus.C (ShowInsertMenu): rename "Figure" to "Graphic", + "Table" to "Table Box", "Float" to "Floating Material"; deletes + the "Float" from each of the subitems. + (ShowHelpMenu): add entry for "FAQ" and "TOC". + + * src/support/DebugStream.h: add an #ifdef to work around a gcc + 2.8.x compiler error. Yes, I know, gcc 2.8.1 is bad, but I + documented the change so that the workaround can be nuked later. + + * src/lyx_gui_misc.C (getScreenDPI): new function. Code moved from + LyX::init(). + + * src/lyxlex_pimpl.C (next): do not re-declare the default value + of arguments. + * src/buffer.C (getLatexName): ditto + (setReadonly): ditto + 2000-04-11 Lars Gullik Bjønnes * src/LaTeXFeatures.h: add a const reference to BufferParams, to avoid some uses of current_view. Added also a bufferParams() - mathod to get at this. + method to get at this. * src/lyxtext.h: changed params->buffer and paramters->bparams. 2000-04-10 Lars Gullik Bjønnes * src/lyxparagraph.[Ch]: removed - operator<(LyXParagraph::InsetTabe..., added a struct matchIT + operator<(LyXParagraph::InsetTable..., added a struct matchIT with operators used by lower_bound and upper_bound in InsetTable's Make struct InsetTable private again. Used matchpos. @@ -106,23 +133,23 @@ * src/*: Add "explicit" on several constructors, I added probably some unneeded ones. A couple of changes to code because of this. - * src/BufferView.[Ch]: Used the "pimpl" idom to hide more of the + * src/BufferView.[Ch]: Used the "pimpl" idiom to hide more of the implementation and private parts from the users of BufferView. Not quite finished. - * src/lyxlex.[Ch]: Used the "pimpl" idom to hide more of the - implementaaion and private parts from the users of LyXLex. Not + * src/lyxlex.[Ch]: Used the "pimpl" idiom to hide more of the + implementation and private parts from the users of LyXLex. Not quite finished. * src/BufferView_pimpl.[Ch]: new files * src/lyxlex_pimpl.[Ch]: new files - * src/LyXView.[Ch]: some inline functios move out-of-line + * src/LyXView.[Ch]: some inline functions move out-of-line 2000-04-04 Jean-Marc Lasgouttes - * src/lyxparagraph.h: make strict InsetTable public. + * src/lyxparagraph.h: make struct InsetTable public. * src/support/lyxstring.h: change lyxstring::difference_type to be ptrdiff_t. Add std:: modifiers to streams. diff --git a/src/buffer.C b/src/buffer.C index b5e5d99dc2..f36aa069e7 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -167,14 +167,14 @@ Buffer::~Buffer() } -string Buffer::getLatexName(bool no_path = true) const +string Buffer::getLatexName(bool no_path /* = true */) const { return ChangeExtension(MakeLatexName(filename), ".tex", no_path); } -void Buffer::setReadonly(bool flag = true) +void Buffer::setReadonly(bool flag /* = true */) { if (read_only != flag) { read_only = flag; diff --git a/src/insets/insetlatexaccent.C b/src/insets/insetlatexaccent.C index cf0ef61651..076dcace2e 100644 --- a/src/insets/insetlatexaccent.C +++ b/src/insets/insetlatexaccent.C @@ -180,7 +180,7 @@ void InsetLatexAccent::checkContents() plusasc = true; // at the top (not really needed) break; default: - printf ("Default\n"); + lyxerr[Debug::KEY] << "Default" << endl; // unknow accent (or something else) return; } diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index 96959eb131..dc3a66d733 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -409,3 +409,11 @@ void WarnReadonly(string const & file) _("The document is read-only:"), file); } + +/// Get the dpi setting of the current screen +float getScreenDPI() +{ + Screen * scr = DefaultScreenOfDisplay(fl_get_display()); + return ((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) + + (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2; +} diff --git a/src/lyx_gui_misc.h b/src/lyx_gui_misc.h index 485c30f341..f9c6107e33 100644 --- a/src/lyx_gui_misc.h +++ b/src/lyx_gui_misc.h @@ -61,6 +61,9 @@ std::pair askForText(string const & msg, /// Informs the user that changes in the coming form will be ignored void WarnReadonly(string const & file); +/// Get the dpi setting of the current screen +float getScreenDPI(); + // inlined functions /// rings the audio bell. inline diff --git a/src/lyx_main.C b/src/lyx_main.C index 93342fcc67..9960324420 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -336,16 +336,13 @@ void LyX::init(int */*argc*/, char **argv, bool gui) lyxrc.lastfiles = AddName(user_lyxdir, "lastfiles"); } - // Calculate screen dpi as average of x-DPI and y-DPI: // Disable gui when either lyxrc or easyparse says so if (!gui) lyxrc.use_gui = false; // Calculate screen dpi as average of x-DPI and y-DPI: if (lyxrc.use_gui) { - Screen * scr = DefaultScreenOfDisplay(fl_get_display()); - lyxrc.dpi = ((HeightOfScreen(scr)* 25.4 / HeightMMOfScreen(scr)) + - (WidthOfScreen(scr)* 25.4 / WidthMMOfScreen(scr))) / 2; + lyxrc.dpi = getScreenDPI(); lyxerr[Debug::INFO] << "DPI setting detected to be " << lyxrc.dpi + 0.5 << endl; } else { diff --git a/src/lyxlex_pimpl.C b/src/lyxlex_pimpl.C index 8f9b86ff11..f7674d3991 100644 --- a/src/lyxlex_pimpl.C +++ b/src/lyxlex_pimpl.C @@ -140,7 +140,7 @@ void LyXLex::Pimpl::setStream(istream & i) } -bool LyXLex::Pimpl::next(bool esc = false) +bool LyXLex::Pimpl::next(bool esc /* = false */) { if (!esc) { unsigned char c = 0; // getc() returns an int diff --git a/src/lyxserver.C b/src/lyxserver.C index 2221ddd941..c271a8af80 100644 --- a/src/lyxserver.C +++ b/src/lyxserver.C @@ -430,6 +430,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg) bool server_only = false; while(*p) { // --- 1. check 'header' --- + if (strncmp(p, "LYXSRV:", 7) == 0) { server_only = true; } else if(0!= strncmp(p, "LYXCMD:", 7)) { @@ -527,7 +528,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg) string rval, buf; if (action>= 0) { - rval = serv->func->Dispatch(cmd); + rval = serv->func->Dispatch(action, arg.c_str()); } else { rval = "Unknown command"; } diff --git a/src/menus.C b/src/menus.C index a42aae2481..84a77f2c77 100644 --- a/src/menus.C +++ b/src/menus.C @@ -1277,11 +1277,11 @@ void Menus::ShowInsertMenu(FL_OBJECT * ob, long) int SubInsertFloatList = fl_defpup(FL_ObjWin(ob), _("Floats%t" - "|Figure Float%x71" - "|Table Float%x72" - "|Wide Figure Float%x73" - "|Wide Table Float%l%x74" - "|Algorithm Float%x75")); + "|Figure%x71" + "|Table%x72" + "|Wide Figure%x73" + "|Wide Table%l%x74" + "|Algorithm%x75")); fl_setpup_shortcut(SubInsertFloatList, 71, scex(_("IMF|gG#g#G"))); fl_setpup_shortcut(SubInsertFloatList, 72, scex(_("IMF|Tt#t#T"))); @@ -1310,14 +1310,14 @@ void Menus::ShowInsertMenu(FL_OBJECT * ob, long) fl_setpup_shortcut(SubInsertSpecial, 38, scex(_("IMS|Mm#m#M"))); int InsertMenu = fl_defpup(FL_ObjWin(ob), - _("Figure..." - "|Table...%l" + _("Graphic..." + "|Table Box...%l" "|Include File..." "|Import ASCII File%m" "|Insert LyX File...%l" "|Footnote" "|Margin Note" - "|Floats%m%l" + "|Floating Material%m%l" "|Lists & TOC%m%l" "|Special Character%m%l" "|Note..." @@ -1615,6 +1615,7 @@ static char const * doc_files [] = {"Intro", "Tutorial", "UserGuide", "Extended", "Customization", "Reference", + "FAQ", "TOC", "BUGS", "LaTeXConfig"}; void Menus::ShowHelpMenu(FL_OBJECT * ob, long) @@ -1633,6 +1634,8 @@ void Menus::ShowHelpMenu(FL_OBJECT * ob, long) "|Extended Features" "|Customization" "|Reference Manual" + "|FAQ" + "|Table of Contents" "|Known Bugs" "|LaTeX Configuration%l" "|Copyright and Warranty..." @@ -1645,11 +1648,13 @@ void Menus::ShowHelpMenu(FL_OBJECT * ob, long) fl_setpup_shortcut(HelpMenu, 4, scex(_("HM|xX#x#X"))); fl_setpup_shortcut(HelpMenu, 5, scex(_("HM|Cc#C#c"))); fl_setpup_shortcut(HelpMenu, 6, scex(_("HM|Rr#R#r"))); - fl_setpup_shortcut(HelpMenu, 7, scex(_("HM|Kk#K#k"))); - fl_setpup_shortcut(HelpMenu, 8, scex(_("HM|Ll#L#l"))); - fl_setpup_shortcut(HelpMenu, 9, scex(_("HM|oO#o#O"))); - fl_setpup_shortcut(HelpMenu, 10, scex(_("HM|eE#e#E"))); - fl_setpup_shortcut(HelpMenu, 11, scex(_("HM|Vv#v#V"))); + fl_setpup_shortcut(HelpMenu, 7, scex(_("HM|Ff#F#f"))); + fl_setpup_shortcut(HelpMenu, 8, scex(_("HM|aA#a#A"))); + fl_setpup_shortcut(HelpMenu, 9, scex(_("HM|Kk#K#k"))); + fl_setpup_shortcut(HelpMenu, 10, scex(_("HM|Ll#L#l"))); + fl_setpup_shortcut(HelpMenu, 11, scex(_("HM|oO#o#O"))); + fl_setpup_shortcut(HelpMenu, 12, scex(_("HM|eE#e#E"))); + fl_setpup_shortcut(HelpMenu, 13, scex(_("HM|Vv#v#V"))); fl_setpup_position( men->_view->getForm()->x + ob->x, @@ -1663,14 +1668,14 @@ void Menus::ShowHelpMenu(FL_OBJECT * ob, long) switch (choice) { case 1: case 2: case 3: case 4: case 5: - case 6: case 7: case 8: + case 6: case 7: case 8: case 9: case 10: ProhibitInput(); men->MenuDocu(doc_files[choice - 1]); AllowInput(); break; - case 9: ShowCopyright(); break; - case 10: ShowCredits(); break; - case 11: + case 11: ShowCopyright(); break; + case 12: ShowCredits(); break; + case 13: ProhibitInput(); fl_show_message((string(_("LyX Version ")) + LYX_VERSION + _(" of ") + LYX_RELEASE).c_str(), diff --git a/src/support/DebugStream.h b/src/support/DebugStream.h index 9e87488a08..b19c4b812b 100644 --- a/src/support/DebugStream.h +++ b/src/support/DebugStream.h @@ -82,7 +82,15 @@ struct Debug { debug[Debug::type(Debug::INFO | Debug::CRIT)] << "...info/crit...\n"; */ + +// This workaround is needed only for gcc 2.8.1 (and possibly egcs +// 1.0.x), which generates a compiler error when subclassing from +// std::. (JMarc) +#ifdef CXX_WORKING_NAMESPACES class DebugStream : public std::ostream { +#else +class DebugStream : public ostream { +#endif public: /// Constructor, sets the debug level to t. explicit DebugStream(Debug::type t = Debug::NONE); diff --git a/src/tex-strings.C b/src/tex-strings.C index d194b5bc2f..808917a393 100644 --- a/src/tex-strings.C +++ b/src/tex-strings.C @@ -66,7 +66,7 @@ char const * tex_graphics[] = {"default", "dvips", "dvitops", "emtex", "ln", "oztex", "textures", "none", ""}; -char const * tex_fonts[] = {"default", "times", "palatino", "helvet", "avant", - "newcent", "bookman", ""}; +char const * tex_fonts[] = {"default", "pslatex", "times", "palatino", + "helvet", "avant", "newcent", "bookman", ""}; -- 2.39.2