More very minor syncing ..

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4375 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-06-12 03:16:41 +00:00
parent ab5f0efdcb
commit 6da2c4d96d
14 changed files with 98 additions and 89 deletions

View File

@ -1,3 +1,12 @@
2002-06-12 John Levon <moz@compsoc.man.ac.uk>
* intl.C:
* intl.h:
* kbmap.C:
* kbsequence.C:
* lyx_cb.C:
* lyx_main.C: minor tidy
2002-06-12 John Levon <moz@compsoc.man.ac.uk> 2002-06-12 John Levon <moz@compsoc.man.ac.uk>
* BufferView_pimpl.h: * BufferView_pimpl.h:

View File

@ -1,3 +1,12 @@
2002-06-12 John Levon <moz@compsoc.man.ac.uk>
* ColorHandler.C:
* FontInfo.h:
* FormBase.C:
* FormBaseDeprecated.C:
* MathsSymbols.C:
* Menubar_pimpl.C: minor cleanups
2002-06-12 John Levon <moz@compsoc.man.ac.uk> 2002-06-12 John Levon <moz@compsoc.man.ac.uk>
* xformsGImage.C: * xformsGImage.C:

View File

@ -2,7 +2,7 @@
* ====================================================== * ======================================================
* *
* LyX, The Document Processor * LyX, The Document Processor
* *
* Copyright 1998-2001 The LyX Team * Copyright 1998-2001 The LyX Team
* *
*======================================================*/ *======================================================*/
@ -18,28 +18,26 @@
#include "gettext.h" #include "gettext.h"
#include "debug.h" #include "debug.h"
#include "frontends/GUIRunTime.h" #include <cmath>
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
#include <cmath>
#ifndef CXX_GLOBAL_CSTD #ifndef CXX_GLOBAL_CSTD
using std::pow; using std::pow;
#endif #endif
using std::endl; using std::endl;
#include FORMS_H_LOCATION
LyXColorHandler::LyXColorHandler() LyXColorHandler::LyXColorHandler()
{ {
display = GUIRunTime::x11Display(); display = fl_get_display();
drawable = XCreatePixmap(display, drawable = XCreatePixmap(display,
RootWindow(display, GUIRunTime::x11Screen()), RootWindow(display, fl_screen),
10, 10, 10, 10, fl_get_visual_depth());
GUIRunTime::x11VisualDepth());
colormap = fl_state[fl_get_vclass()].colormap;
colormap = GUIRunTime::x11Colormap();
// Clear the GC cache // Clear the GC cache
for (int i = 0; i <= LColor::ignore; ++i) { for (int i = 0; i <= LColor::ignore; ++i) {
colorGCcache[i] = 0; colorGCcache[i] = 0;

View File

@ -88,4 +88,5 @@ private:
/// Build newly sized font string /// Build newly sized font string
string const resize(string const &, int size) const; string const resize(string const &, int size) const;
}; };
#endif
#endif // FONTINFO_H

View File

@ -16,7 +16,6 @@
#include "FormBase.h" #include "FormBase.h"
#include "xformsBC.h" #include "xformsBC.h"
#include "xforms_resize.h" #include "xforms_resize.h"
#include "GUIRunTime.h"
#include "Tooltips.h" #include "Tooltips.h"
#include "support/LAssert.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 // So we try to clear out motion events in the queue before the
// DestroyNotify // DestroyNotify
XSync(fl_get_display(), false); XSync(fl_get_display(), false);
GUIRunTime::processEvents();
if (form() && form()->visible) if (form() && form()->visible)
fl_hide_form(form()); fl_hide_form(form());

View File

@ -16,7 +16,6 @@
#include "FormBaseDeprecated.h" #include "FormBaseDeprecated.h"
#include "xformsBC.h" #include "xformsBC.h"
#include "xforms_resize.h" #include "xforms_resize.h"
#include "GUIRunTime.h"
#include "Tooltips.h" #include "Tooltips.h"
#include "lyxrc.h" #include "lyxrc.h"
@ -140,7 +139,6 @@ void FormBaseDeprecated::hide()
// So we try to clear out motion events in the queue before the // So we try to clear out motion events in the queue before the
// DestroyNotify // DestroyNotify
XSync(fl_get_display(), false); XSync(fl_get_display(), false);
GUIRunTime::processEvents();
if (form() && form()->visible) { if (form() && form()->visible) {
// some dialogs might do things to the form first // some dialogs might do things to the form first

View File

@ -20,7 +20,6 @@
#include "support/lstrings.h" #include "support/lstrings.h"
#include "debug.h" #include "debug.h"
#include "MathsSymbols.h" #include "MathsSymbols.h"
#include "GUIRunTime.h"
using std::max; using std::max;
using std::endl; using std::endl;
@ -30,6 +29,8 @@ using std::ostream;
using std::strstr; using std::strstr;
#endif #endif
#include FORMS_H_LOCATION
/* Latex code for those bitmaps */ /* Latex code for those bitmaps */
#include "greek.xbm" #include "greek.xbm"
@ -384,7 +385,7 @@ static char const ** pixmapFromBitmapData(char const * s, int wx, int hx)
} }
int ww = w / dw; int ww = w / dw;
int hh = h / dh; 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<char*>(reinterpret_cast<char const *>(bdata)), w, h, 8, 0); const_cast<char*>(reinterpret_cast<char const *>(bdata)), w, h, 8, 0);
xima->byte_order = LSBFirst; xima->byte_order = LSBFirst;
xima->bitmap_bit_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 (ww > wx) ww = wx;
if (hh > hx) hh = hx; if (hh > hx) hh = hx;
XImage * sbima = XSubImage(xima, x, y, ww, hh); XImage * sbima = XSubImage(xima, x, y, ww, hh);
XpmCreateDataFromImage(GUIRunTime::x11Display(), const_cast<char***>(&data), sbima, sbima, 0); XpmCreateDataFromImage(fl_get_display(), const_cast<char***>(&data), sbima, sbima, 0);
// Dirty hack to get blue symbols quickly // Dirty hack to get blue symbols quickly
char * sx = const_cast<char*>(strstr(data[2], "FFFFFFFF")); char * sx = const_cast<char*>(strstr(data[2], "FFFFFFFF"));

View File

@ -157,34 +157,30 @@ void Menubar::Pimpl::makeMenubar(Menu const & menu)
void Menubar::Pimpl::set(string const & menu_name) void Menubar::Pimpl::set(string const & menu_name)
{ {
lyxerr[Debug::GUI] << "Entering Menubar::Pimpl::set " if (menu_name == current_menu_name_)
<< "for menu `" << menu_name << "'" << endl; return;
MenubarMap::iterator mbit = menubarmap_.find(menu_name);
if (menu_name != current_menu_name_) { if (mbit == menubarmap_.end()) {
MenubarMap::iterator mbit = menubarmap_.find(menu_name); lyxerr << "ERROR:set: Unknown menu `" << menu_name
<< "'" << endl;
return;
}
if (mbit == menubarmap_.end()) { if (current_group_) {
lyxerr << "ERROR:set: Unknown menu `" << menu_name lyxerr[Debug::GUI] << " hiding group "
<< "'" << endl; << current_group_ << endl;
return; fl_hide_object(current_group_);
} }
if (current_group_) { lyxerr[Debug::GUI] << " showing group "
lyxerr[Debug::GUI] << " hiding group " << mbit->second << endl;
<< current_group_ << endl; fl_show_object(mbit->second);
fl_hide_object(current_group_); current_menu_name_ = menu_name;
} current_group_ = mbit->second;
lyxerr[Debug::GUI] << "Menubar::Pimpl::set: Menubar set."
lyxerr[Debug::GUI] << " showing group " << endl;
<< 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;
} }

View File

@ -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 * \author unknown
* * \author John Levon <moz@compsoc.man.ac.uk>
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
/*
* International support for LyX
*/ */
#include <config.h> #include <config.h>

View File

@ -1,5 +1,14 @@
// -*- C++ -*- // -*- C++ -*-
/* International support for LyX */ /**
* \file intl.h
* Copyright 1995-2002 the LyX Team
* Read the file COPYING
*
* \author unknown
* \author John Levon <moz@compsoc.man.ac.uk>
*/
#ifndef INTL_H #ifndef INTL_H
#define INTL_H #define INTL_H
@ -11,6 +20,10 @@
#include "trans_mgr.h" #include "trans_mgr.h"
/**
* This class is used for managing keymaps
* for composing characters in LyX.
*/
class Intl { class Intl {
public: public:
/// which keymap is currently used ? /// which keymap is currently used ?

View File

@ -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 * \author unknown
* * \author John Levon <moz@compsoc.man.ac.uk>
* Copyright 1995 Matthias Ettrich */
* Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#include <config.h> #include <config.h>
#include <X11/Xlib.h>
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation #pragma implementation
#endif #endif
@ -21,6 +18,8 @@
#include "kbsequence.h" #include "kbsequence.h"
#include "debug.h" #include "debug.h"
#include <X11/Xlib.h>
using std::endl; using std::endl;
// The only modifiers that we handle. We want to throw away things // The only modifiers that we handle. We want to throw away things

View File

@ -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 * \author John Levon <moz@compsoc.man.ac.uk>
* */
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#include <config.h> #include <config.h>
//#include <cstring>
#include <X11/Xlib.h>
#include "gettext.h" #include "gettext.h"
@ -24,6 +20,7 @@
#include "commandtags.h" #include "commandtags.h"
#include "debug.h" #include "debug.h"
#include <X11/Xlib.h>
using std::make_pair; using std::make_pair;
using std::vector; using std::vector;
@ -67,6 +64,7 @@ string::size_type kb_sequence::parse(string const & s)
string::size_type i = 0; string::size_type i = 0;
key_modifier::state mod = key_modifier::none; key_modifier::state mod = key_modifier::none;
key_modifier::state nmod = key_modifier::none; key_modifier::state nmod = key_modifier::none;
while (i < s.length()) { while (i < s.length()) {
if (s[i] == ' ') if (s[i] == ' ')
++i; ++i;

View File

@ -28,7 +28,7 @@
#include "frontends/Alert.h" #include "frontends/Alert.h"
#include "frontends/FileDialog.h" #include "frontends/FileDialog.h"
#include "frontends/GUIRunTime.h" #include <X11/Xlib.h>
#include "support/FileInfo.h" #include "support/FileInfo.h"
#include "support/filetools.h" #include "support/filetools.h"
@ -81,9 +81,6 @@ void ShowMessage(Buffer const * buf,
// should be moved to lyxfunc.C // should be moved to lyxfunc.C
bool MenuWrite(BufferView * bv, Buffer * buffer) bool MenuWrite(BufferView * bv, Buffer * buffer)
{ {
// FIXME: needed ?
XFlush(GUIRunTime::x11Display());
if (!buffer->save()) { if (!buffer->save()) {
if (Alert::askQuestion(_("Save failed. Rename and try again?"), if (Alert::askQuestion(_("Save failed. Rename and try again?"),
MakeDisplayPath(buffer->fileName(), 50), MakeDisplayPath(buffer->fileName(), 50),

View File

@ -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 * \author unknown
* */
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#include <config.h> #include <config.h>
#include <version.h> #include <version.h>
@ -62,9 +60,8 @@ extern void QuitLyX();
string system_lyxdir; string system_lyxdir;
string build_lyxdir; string build_lyxdir;
string system_tempdir; string system_tempdir;
string user_lyxdir; // Default $HOME/.lyx string user_lyxdir;
// Should this be kept global? Asger says Yes.
DebugStream lyxerr; DebugStream lyxerr;
boost::scoped_ptr<LastFiles> lastfiles; boost::scoped_ptr<LastFiles> lastfiles;