From 6da2c4d96da02e79c0d14ce2b8d50324693f83c1 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 12 Jun 2002 03:16:41 +0000 Subject: [PATCH] More very minor syncing .. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4375 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 9 +++++ src/frontends/xforms/ChangeLog | 9 +++++ src/frontends/xforms/ColorHandler.C | 18 ++++----- src/frontends/xforms/FontInfo.h | 3 +- src/frontends/xforms/FormBase.C | 2 - src/frontends/xforms/FormBaseDeprecated.C | 2 - src/frontends/xforms/MathsSymbols.C | 7 ++-- src/frontends/xforms/Menubar_pimpl.C | 46 +++++++++++------------ src/intl.C | 17 +++------ src/intl.h | 15 +++++++- src/kbmap.C | 19 +++++----- src/kbsequence.C | 18 ++++----- src/lyx_cb.C | 5 +-- src/lyx_main.C | 17 ++++----- 14 files changed, 98 insertions(+), 89 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b384286b10..0aff058a0d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2002-06-12 John Levon + + * intl.C: + * intl.h: + * kbmap.C: + * kbsequence.C: + * lyx_cb.C: + * lyx_main.C: minor tidy + 2002-06-12 John Levon * BufferView_pimpl.h: diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 96d35c5fa1..15af5bf164 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,12 @@ +2002-06-12 John Levon + + * ColorHandler.C: + * FontInfo.h: + * FormBase.C: + * FormBaseDeprecated.C: + * MathsSymbols.C: + * Menubar_pimpl.C: minor cleanups + 2002-06-12 John Levon * xformsGImage.C: diff --git a/src/frontends/xforms/ColorHandler.C b/src/frontends/xforms/ColorHandler.C index 1c3be28104..e6092483cc 100644 --- a/src/frontends/xforms/ColorHandler.C +++ b/src/frontends/xforms/ColorHandler.C @@ -2,7 +2,7 @@ * ====================================================== * * LyX, The Document Processor - * + * * Copyright 1998-2001 The LyX Team * *======================================================*/ @@ -18,28 +18,26 @@ #include "gettext.h" #include "debug.h" -#include "frontends/GUIRunTime.h" +#include #include -#include - #ifndef CXX_GLOBAL_CSTD using std::pow; #endif using std::endl; +#include FORMS_H_LOCATION LyXColorHandler::LyXColorHandler() { - display = GUIRunTime::x11Display(); + display = fl_get_display(); drawable = XCreatePixmap(display, - RootWindow(display, GUIRunTime::x11Screen()), - 10, 10, - GUIRunTime::x11VisualDepth()); - - colormap = GUIRunTime::x11Colormap(); + RootWindow(display, fl_screen), + 10, 10, fl_get_visual_depth()); + + colormap = fl_state[fl_get_vclass()].colormap; // Clear the GC cache for (int i = 0; i <= LColor::ignore; ++i) { colorGCcache[i] = 0; diff --git a/src/frontends/xforms/FontInfo.h b/src/frontends/xforms/FontInfo.h index 6a9ecf0893..1fd99f5929 100644 --- a/src/frontends/xforms/FontInfo.h +++ b/src/frontends/xforms/FontInfo.h @@ -88,4 +88,5 @@ private: /// Build newly sized font string string const resize(string const &, int size) const; }; -#endif + +#endif // FONTINFO_H diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index b9c70fa0ae..a8cf7224e5 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -16,7 +16,6 @@ #include "FormBase.h" #include "xformsBC.h" #include "xforms_resize.h" -#include "GUIRunTime.h" #include "Tooltips.h" #include "support/LAssert.h" @@ -118,7 +117,6 @@ void FormBase::hide() // So we try to clear out motion events in the queue before the // DestroyNotify XSync(fl_get_display(), false); - GUIRunTime::processEvents(); if (form() && form()->visible) fl_hide_form(form()); diff --git a/src/frontends/xforms/FormBaseDeprecated.C b/src/frontends/xforms/FormBaseDeprecated.C index 944ab3cda6..89bfc0b0da 100644 --- a/src/frontends/xforms/FormBaseDeprecated.C +++ b/src/frontends/xforms/FormBaseDeprecated.C @@ -16,7 +16,6 @@ #include "FormBaseDeprecated.h" #include "xformsBC.h" #include "xforms_resize.h" -#include "GUIRunTime.h" #include "Tooltips.h" #include "lyxrc.h" @@ -140,7 +139,6 @@ void FormBaseDeprecated::hide() // So we try to clear out motion events in the queue before the // DestroyNotify XSync(fl_get_display(), false); - GUIRunTime::processEvents(); if (form() && form()->visible) { // some dialogs might do things to the form first diff --git a/src/frontends/xforms/MathsSymbols.C b/src/frontends/xforms/MathsSymbols.C index a5cd5aca95..e44e6b322d 100644 --- a/src/frontends/xforms/MathsSymbols.C +++ b/src/frontends/xforms/MathsSymbols.C @@ -20,7 +20,6 @@ #include "support/lstrings.h" #include "debug.h" #include "MathsSymbols.h" -#include "GUIRunTime.h" using std::max; using std::endl; @@ -30,6 +29,8 @@ using std::ostream; using std::strstr; #endif +#include FORMS_H_LOCATION + /* Latex code for those bitmaps */ #include "greek.xbm" @@ -384,7 +385,7 @@ static char const ** pixmapFromBitmapData(char const * s, int wx, int hx) } int ww = w / dw; int hh = h / dh; - XImage * xima = XCreateImage(GUIRunTime::x11Display(), 0, 1, XYBitmap, 0, + XImage * xima = XCreateImage(fl_get_display(), 0, 1, XYBitmap, 0, const_cast(reinterpret_cast(bdata)), w, h, 8, 0); xima->byte_order = LSBFirst; xima->bitmap_bit_order = LSBFirst; @@ -393,7 +394,7 @@ static char const ** pixmapFromBitmapData(char const * s, int wx, int hx) if (ww > wx) ww = wx; if (hh > hx) hh = hx; XImage * sbima = XSubImage(xima, x, y, ww, hh); - XpmCreateDataFromImage(GUIRunTime::x11Display(), const_cast(&data), sbima, sbima, 0); + XpmCreateDataFromImage(fl_get_display(), const_cast(&data), sbima, sbima, 0); // Dirty hack to get blue symbols quickly char * sx = const_cast(strstr(data[2], "FFFFFFFF")); diff --git a/src/frontends/xforms/Menubar_pimpl.C b/src/frontends/xforms/Menubar_pimpl.C index b05b93690d..adf74431e5 100644 --- a/src/frontends/xforms/Menubar_pimpl.C +++ b/src/frontends/xforms/Menubar_pimpl.C @@ -157,34 +157,30 @@ void Menubar::Pimpl::makeMenubar(Menu const & menu) void Menubar::Pimpl::set(string const & menu_name) { - lyxerr[Debug::GUI] << "Entering Menubar::Pimpl::set " - << "for menu `" << menu_name << "'" << endl; - - if (menu_name != current_menu_name_) { - MenubarMap::iterator mbit = menubarmap_.find(menu_name); + if (menu_name == current_menu_name_) + return; + + MenubarMap::iterator mbit = menubarmap_.find(menu_name); - if (mbit == menubarmap_.end()) { - lyxerr << "ERROR:set: Unknown menu `" << menu_name - << "'" << endl; - return; - } + if (mbit == menubarmap_.end()) { + lyxerr << "ERROR:set: Unknown menu `" << menu_name + << "'" << endl; + return; + } - if (current_group_) { - lyxerr[Debug::GUI] << " hiding group " - << current_group_ << endl; - fl_hide_object(current_group_); - } + if (current_group_) { + lyxerr[Debug::GUI] << " hiding group " + << current_group_ << endl; + fl_hide_object(current_group_); + } - lyxerr[Debug::GUI] << " showing group " - << mbit->second << endl; - fl_show_object(mbit->second); - current_menu_name_ = menu_name; - current_group_ = mbit->second; - lyxerr[Debug::GUI] << "Menubar::Pimpl::set: Menubar set." - << endl; - } else - lyxerr [Debug::GUI] << "Menubar::Pimpl::set: Nothing to do." - << endl; + lyxerr[Debug::GUI] << " showing group " + << mbit->second << endl; + fl_show_object(mbit->second); + current_menu_name_ = menu_name; + current_group_ = mbit->second; + lyxerr[Debug::GUI] << "Menubar::Pimpl::set: Menubar set." + << endl; } diff --git a/src/intl.C b/src/intl.C index 6eac587bc6..0f65aead5c 100644 --- a/src/intl.C +++ b/src/intl.C @@ -1,15 +1,10 @@ -/* This file is part of - * ====================================================== +/** + * \file intl.C + * Copyright 1995-2002 the LyX Team + * Read the file COPYING * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. - * - * ====================================================== */ - -/* - * International support for LyX + * \author unknown + * \author John Levon */ #include diff --git a/src/intl.h b/src/intl.h index e83ad9d7a5..e2dfad5922 100644 --- a/src/intl.h +++ b/src/intl.h @@ -1,5 +1,14 @@ // -*- C++ -*- -/* International support for LyX */ +/** + * \file intl.h + * Copyright 1995-2002 the LyX Team + * Read the file COPYING + * + * \author unknown + * \author John Levon + */ + + #ifndef INTL_H #define INTL_H @@ -11,6 +20,10 @@ #include "trans_mgr.h" +/** + * This class is used for managing keymaps + * for composing characters in LyX. + */ class Intl { public: /// which keymap is currently used ? diff --git a/src/kbmap.C b/src/kbmap.C index 296a713e92..1fd6b6dafe 100644 --- a/src/kbmap.C +++ b/src/kbmap.C @@ -1,17 +1,14 @@ -/* This file is part of - * ====================================================== +/** + * \file kbmap.C + * Copyright 1995-2002 the LyX Team + * Read the file COPYING * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. - * - * ====================================================== */ + * \author unknown + * \author John Levon + */ #include -#include - #ifdef __GNUG__ #pragma implementation #endif @@ -21,6 +18,8 @@ #include "kbsequence.h" #include "debug.h" +#include + using std::endl; // The only modifiers that we handle. We want to throw away things diff --git a/src/kbsequence.C b/src/kbsequence.C index 4292a9b90b..b3865a1a65 100644 --- a/src/kbsequence.C +++ b/src/kbsequence.C @@ -1,16 +1,12 @@ -/* This file is part of - * ====================================================== +/** + * \file kbsequence.C + * Copyright 1995-2002 the LyX Team + * Read the file COPYING * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. - * - * ====================================================== */ + * \author John Levon + */ #include -//#include -#include #include "gettext.h" @@ -24,6 +20,7 @@ #include "commandtags.h" #include "debug.h" +#include using std::make_pair; using std::vector; @@ -67,6 +64,7 @@ string::size_type kb_sequence::parse(string const & s) string::size_type i = 0; key_modifier::state mod = key_modifier::none; key_modifier::state nmod = key_modifier::none; + while (i < s.length()) { if (s[i] == ' ') ++i; diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 7d52cadc5d..51bb428061 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -28,7 +28,7 @@ #include "frontends/Alert.h" #include "frontends/FileDialog.h" -#include "frontends/GUIRunTime.h" +#include #include "support/FileInfo.h" #include "support/filetools.h" @@ -81,9 +81,6 @@ void ShowMessage(Buffer const * buf, // should be moved to lyxfunc.C bool MenuWrite(BufferView * bv, Buffer * buffer) { - // FIXME: needed ? - XFlush(GUIRunTime::x11Display()); - if (!buffer->save()) { if (Alert::askQuestion(_("Save failed. Rename and try again?"), MakeDisplayPath(buffer->fileName(), 50), diff --git a/src/lyx_main.C b/src/lyx_main.C index 6ea4b34dc4..39daf6ecd9 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -1,12 +1,10 @@ -/* This file is part of - * ====================================================== +/** + * \file lyx_main.C + * Copyright 1995-2002 the LyX Team + * Read the file COPYING * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. - * - * ====================================================== */ + * \author unknown + */ #include #include @@ -62,9 +60,8 @@ extern void QuitLyX(); string system_lyxdir; string build_lyxdir; string system_tempdir; -string user_lyxdir; // Default $HOME/.lyx +string user_lyxdir; -// Should this be kept global? Asger says Yes. DebugStream lyxerr; boost::scoped_ptr lastfiles; -- 2.39.2