]> git.lyx.org Git - lyx.git/commitdiff
remove more forms.h cruft
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 3 Jul 2001 16:13:01 +0000 (16:13 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 3 Jul 2001 16:13:01 +0000 (16:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2177 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
src/ChangeLog
src/ColorHandler.C
src/FontInfo.C
src/FontLoader.C
src/Painter.C
src/frontends/ChangeLog
src/frontends/GUIRunTime.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/GUIRunTime.C
src/graphics/ChangeLog
src/graphics/ImageLoaderXPM.C
src/lyx_cb.C

index 133089743444c85cb7977f1596d6b964c68aa3c9..42766b5512a3ebcd26a4aeff07c7fb252f5c119a 100644 (file)
@@ -1,3 +1,15 @@
+2001-07-03  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * ColorHandler.C (LyXColorHandler): use GUIRunTime instead of
+       calling directly xforms functions.
+
+       * Painter.C (Painter): 
+       * lyx_cb.C (MenuWrite): 
+       * FontInfo.C (query): use GUIRunTime::x11Display() instead of
+       fl_display.
+
+       * lyx_gui.C: remove bogus guiruntime extern declaration.
+
 2001-07-03  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * text2.C (redoHeightOfParagraph): comment out stuff we don't need
@@ -20,7 +32,7 @@
        * XFormsView.[Ch]: new files
 
        * LyXView.[Ch]: make LyXView a base class for the gui handling for
-       the main window. Move the gui dependand stuff to XFormsView
+       the main window. Move the gui dependent stuff to XFormsView
 
 2001-07-03  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
index e2750572e837c488bf1601f02290dab37ac441e0..2272dd12aeed9db4a175b4b88dd2624a1ce274cd 100644 (file)
 
 #include <cmath>
 
-#include FORMS_H_LOCATION
-#include "debug.h"
-
+#include "frontends/GUIRunTime.h"
 #include "ColorHandler.h"
 #include "LColor.h"
 #include "gettext.h"
+#include "debug.h"
 
 using std::endl;
 
 LyXColorHandler::LyXColorHandler() 
 {
-       display = fl_get_display();
-       drawable = XCreatePixmap(display, fl_root, 10, 10,
-                                fl_get_visual_depth());
+       display = GUIRunTime::x11Display();
+       drawable = XCreatePixmap(display,
+                                RootWindow(display, GUIRunTime::x11Screen()),
+                                10, 10,
+                                GUIRunTime::x11VisualDepth());
        
-       colormap = fl_state[fl_get_vclass()].colormap;
+       colormap = GUIRunTime::x11Colormap();
        // Clear the GC cache
        for (int i = 0; i <= LColor::ignore; ++i) {
                colorGCcache[i] = 0;
index d87c199475d658855e6cae8fed3e25f29dc802aa..43aa03c5770277ea01e79389ef3b466c3b99ed97 100644 (file)
@@ -11,8 +11,6 @@
 #include <config.h>
 #include <cmath>       // fabs()
 
-#include FORMS_H_LOCATION
-
 #ifdef __GNUG__
 #pragma implementation "FontInfo.h"
 #endif
@@ -21,6 +19,7 @@
 #include "debug.h"
 #include "lyxrc.h"     // lyxrc.use_scalable_fonts
 #include "support/lstrings.h"
+#include "frontends/GUIRunTime.h"
 
 using std::endl;
 
@@ -119,7 +118,8 @@ void FontInfo::query()
 
        char ** list = 0;
        if (lyxrc.use_gui)
-               list = XListFonts(fl_get_display(), pattern.c_str(), 100, &matches);
+               list = XListFonts(GUIRunTime::x11Display(), pattern.c_str(),
+                                 100, &matches);
 
        if (list == 0) {
                // No fonts matched
index 2d456a6b22213dea75a971187f2f47fde7100c9a..f137d806f25c6eb35b738cfe0e79e9773b917539 100644 (file)
@@ -23,6 +23,7 @@
 #include "lyxrc.h"     // lyxrc.font_*
 #include "BufferView.h"
 #include "LyXView.h"
+#include "frontends/GUIRunTime.h"
 
 using std::endl;
 
@@ -84,7 +85,7 @@ void FontLoader::unload()
                                }
                                for (int i4 = 0; i4 < 10; ++i4) {
                                        if (fontstruct[i1][i2][i3][i4]) {
-                                               XFreeFont(fl_get_display(), fontstruct[i1][i2][i3][i4]);
+                                               XFreeFont(GUIRunTime::x11Display(), fontstruct[i1][i2][i3][i4]);
                                                fontstruct[i1][i2][i3][i4] = 0;
                                        }
                                }
@@ -252,14 +253,14 @@ XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
 
        current_view->owner()->messagePush(_("Loading font into X-Server..."));
 
-       fs = XLoadQueryFont(fl_get_display(), font.c_str());
+       fs = XLoadQueryFont(GUIRunTime::x11Display(), font.c_str());
        
        if (fs == 0) {
                if (font == "fixed") {
                        lyxerr << "We're doomed. Can't get 'fixed' font." << endl;
                } else {
                        lyxerr << "Could not get font. Using 'fixed'." << endl;
-                       fs = XLoadQueryFont(fl_get_display(), "fixed");
+                       fs = XLoadQueryFont(GUIRunTime::x11Display(), "fixed");
                }
        } else if (lyxerr.debugging(Debug::FONT)) {
                // Tell user the font matching
index 7b4f1160fa6dc85076b30406ada1b5a5aa0362da..8c731244c3399dc931da2be62255c8781f873254 100644 (file)
 
 #include <cmath>
 
-#include FORMS_H_LOCATION
 #include "Painter.h"
 #include "LString.h"
 #include "debug.h"
 #include "lyxfont.h"
+#include "frontends/GUIRunTime.h"
 #include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "WorkArea.h"
@@ -41,7 +41,7 @@ using std::max;
 Painter::Painter(WorkArea & wa)
        : PainterBase(wa)
 {
-       display = fl_get_display();
+       display = GUIRunTime::x11Display();
 }
 
 
index b0e7172e4370d50f6bd69ae4c6f005c8bf2c787f..9f3ec9e4919274c235d9a3aeefb9228c0bfc62bc 100644 (file)
@@ -1,3 +1,10 @@
+2001-07-03  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * GUIRunTime.h: (x11Display): 
+       (x11Screen): 
+       (x11Colormap): 
+       (x11VisualDepth): new methods
+
 2001-07-03  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * GUIRunTime.h: add createMainView
index 4f489728eece1b0ce63e195bc67aa0bca59fdf7d..156e74c125145a261a736f3b5dbedb1d2fabaa97 100644 (file)
@@ -15,6 +15,7 @@
 #pragma interface
 #endif
 
+#include <X11/Xlib.h>
 class LyXView;
 
 /** The LyX GUI independent guiruntime class
@@ -38,5 +39,19 @@ public:
        ///
        static
        LyXView * createMainView(int w, int h);
+
+/* the following entries are X11 specific and should eventually go away */
+       /// The display on which LyX is running
+       static
+       Display * x11Display();
+       /// The screen on which LyX is running
+       static
+       int x11Screen();
+       /// The current colormap
+       static
+       Colormap x11Colormap();
+       /// The current visual depth
+       static
+       int x11VisualDepth();
 };
 #endif
index f63debfc0dec447208540617aa775a5a56295896..8fe51dca03a0eabf90b2b099079ed4c20a34a8e9 100644 (file)
@@ -1,3 +1,12 @@
+<<<<<<< ChangeLog
+2001-07-03  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * GUIRunTime.C (x11Display): 
+       (x11Screen): 
+       (x11Colormap): 
+       (x11VisualDepth): new methods
+
+=======
 2001-07-03  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * FormDocument.C (class_apply): call CutAndPaste::'s staitc method
@@ -8,6 +17,7 @@
 
        * GUIRunTime.C (createMainView): implement
 
+>>>>>>> 1.104
 2001-06-22  John Levon  <moz@compsoc.man.ac.uk>
 
        * FormCharacter.C:
index 13dd471b58444c1a1d3d75e16dee4ed4ef99de3e..3c24842fddfc51540f4d06bbaabf6d5fbf65d702 100644 (file)
@@ -117,3 +117,27 @@ LyXView * GUIRunTime::createMainView(int w, int h)
 {
        return new XFormsView(w, h);
 }
+
+
+Display * GUIRunTime::x11Display()
+{
+       return fl_get_display();
+}
+
+
+int GUIRunTime::x11Screen()
+{
+       return fl_screen;
+}
+
+
+Colormap GUIRunTime::x11Colormap()
+{
+       return fl_state[fl_get_vclass()].colormap;
+}
+
+
+int GUIRunTime::x11VisualDepth()
+{
+       return fl_get_visual_depth();
+}
index fca4e0c723e8f667b7a2619f98e4fe3961716e04..96489a9ddd13d229398735eb69676cd27d42d850 100644 (file)
@@ -1,3 +1,8 @@
+2001-07-03  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * ImageLoaderXPM.C (runImageLoader): get display information from
+       GUIRunTime. 
+
 2001-06-14  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * GraphicsCache.C:
index e683fdf54d3e656d0bb95d51432c033e593878c8..b92a0bb0113da7c5cf6f7d91b8bda7b3b90051ee 100644 (file)
@@ -14,9 +14,9 @@
 #include <config.h>
 #include "ImageLoaderXPM.h"
 #include "frontends/support/LyXImage.h"
+#include "frontends/GUIRunTime.h"
 #include "support/filetools.h"
 
-#include FORMS_H_LOCATION
 #include XPM_H_LOCATION
 #include <iostream>
 #include <fstream>
@@ -58,13 +58,13 @@ ImageLoaderXPM::loadableFormats() const
 ImageLoader::Result 
 ImageLoaderXPM::runImageLoader(string const & filename)
 {
-       Display * display = fl_get_display();
+       Display * display = GUIRunTime::x11Display();
 
 //(BE 2000-08-05)
 #ifdef WITH_WARNINGS
 #warning This might be a dirty thing, but I dont know any other solution.
 #endif
-       Screen * screen = ScreenOfDisplay(display, fl_screen);
+       Screen * screen = ScreenOfDisplay(display, GUIRunTime::x11Screen());
 
        Pixmap pixmap;
        Pixmap mask;
index 01f8b860759dae73763be56c70b9143d7711526c..c8b5566d2a8b57dace66d87d5ea0578e5b02e0ec 100644 (file)
@@ -15,8 +15,6 @@
 #include <utility> 
 #include <iostream>
 
-#include FORMS_H_LOCATION
-
 #include "lyx_cb.h"
 #include "lyx_gui_misc.h"
 #include "lyx_main.h"
@@ -27,6 +25,7 @@
 #include "lyxrc.h"
 #include "lyxtext.h"
 #include "frontends/FileDialog.h"
+#include "frontends/GUIRunTime.h"
 #include "insets/insetlabel.h"
 #include "support/FileInfo.h"
 #include "support/filetools.h"
@@ -134,7 +133,7 @@ void ShowMessage(Buffer const * buf,
 bool MenuWrite(BufferView * bv, Buffer * buffer)
 {
        // FIXME: needed ?
-       XFlush(fl_get_display());
+       XFlush(GUIRunTime::x11Display());
  
        if (!buffer->save()) {
                string const fname = buffer->fileName();