remove more forms.h cruft

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2177 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2001-07-03 16:13:01 +00:00
parent 2292b739a2
commit 13ae124f46
12 changed files with 96 additions and 22 deletions

View 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>

View File

@ -15,22 +15,23 @@
#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;

View 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

View 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

View File

@ -19,11 +19,11 @@
#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();
}

View 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

View 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

View 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:

View 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();
}

View 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:

View 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;

View 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();