From: Lars Gullik Bjønnes Date: Tue, 22 Aug 2000 18:28:11 +0000 (+0000) Subject: make NEW_TABULAR default, some GUIRunTime changes X-Git-Tag: 1.6.10~22024 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=eff9b6b7c993861880ef7800f3732b32cf694f57;p=features.git make NEW_TABULAR default, some GUIRunTime changes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@983 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/WorkArea.C b/src/WorkArea.C index ca9bd91de1..83f343228c 100644 --- a/src/WorkArea.C +++ b/src/WorkArea.C @@ -29,7 +29,7 @@ FL_OBJECT * figinset_canvas; // needed to make the c++ compiler find the correct version of abs. // This is at least true for g++. -using std::abs; +//using std::abs; static inline void waitForX() diff --git a/src/frontends/GUIRunTime.C b/src/frontends/GUIRunTime.C deleted file mode 100644 index e3e6d0a4f4..0000000000 --- a/src/frontends/GUIRunTime.C +++ /dev/null @@ -1,43 +0,0 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2000 The LyX Team. - * - * @author Jürgen Vigna - * - * ====================================================== */ - - -#include - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include "GUIRunTime.h" -#include "GUIRunTime_pimpl.h" - -GUIRunTime::GUIRunTime() -{ - pimpl_ = new Pimpl; -} - - -GUIRunTime::~GUIRunTime() -{ - delete pimpl_; -} - - -void GUIRunTime::processEvents() -{ - pimpl_->processEvents(); -} - - -void GUIRunTime::runTime() -{ - pimpl_->runTime(); -} diff --git a/src/frontends/GUIRunTime.h b/src/frontends/GUIRunTime.h index fcf0289be1..42f6ec10a7 100644 --- a/src/frontends/GUIRunTime.h +++ b/src/frontends/GUIRunTime.h @@ -6,8 +6,6 @@ * * Copyright 2000 The LyX Team. * - * @author Jürgen Vigna - * * ====================================================== */ #ifndef GUIRUNTIME_H @@ -20,24 +18,16 @@ class LyXView; /** The LyX GUI independent guiruntime class - The GUI interface is implemented in the corresponding GUIRunTime_pimpl class. - */ + The GUI interface is implemented in the corresponding + frontends GUIRunTime.C file. +*/ class GUIRunTime { public: - /// - GUIRunTime(); - /// - ~GUIRunTime(); - /// - void processEvents(); - /// - void runTime(); - - struct Pimpl; - friend struct Pimpl; - -private: - /// - Pimpl * pimpl_; + /// + static + void processEvents(); + /// + static + void runTime(); }; #endif diff --git a/src/frontends/Makefile.am b/src/frontends/Makefile.am index bf382d6ee8..2f826473b1 100644 --- a/src/frontends/Makefile.am +++ b/src/frontends/Makefile.am @@ -14,7 +14,6 @@ libfrontends_la_SOURCES=\ ButtonPolicies.h \ Dialogs.h \ DialogBase.h \ - GUIRunTime.C \ GUIRunTime.h \ Liason.C \ Liason.h \ diff --git a/src/frontends/gnome/GUIRunTime.C b/src/frontends/gnome/GUIRunTime.C new file mode 100644 index 0000000000..24b53c20d2 --- /dev/null +++ b/src/frontends/gnome/GUIRunTime.C @@ -0,0 +1,44 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + *======================================================*/ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include FORMS_H_LOCATION + +#include "GUIRunTime.h" +#include "debug.h" + +#include + +using std::endl; + +extern bool finished; + +void GUIRunTime::processEvents() +{ + while(Gnome::Main::instance()->events_pending()) + Gnome::Main::instance()->iteration(FALSE); +} + + +void GUIRunTime::runTime() +{ + XEvent ev; + while (!finished) { + processEvents(); + if (fl_check_forms() == FL_EVENT) { + lyxerr << "LyX: This shouldn't happen..." << endl; + fl_XNextEvent(&ev); + } + } +} diff --git a/src/frontends/gnome/GUIRunTime_pimpl.C b/src/frontends/gnome/GUIRunTime_pimpl.C deleted file mode 100644 index 47f615855b..0000000000 --- a/src/frontends/gnome/GUIRunTime_pimpl.C +++ /dev/null @@ -1,46 +0,0 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright (C) 2000 The LyX Team. - * - * @author Jürgen Vigna - * - *======================================================*/ - -#include - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include FORMS_H_LOCATION - -#include "GUIRunTime_pimpl.h" -#include "debug.h" - -#include - -using std::endl; - -extern bool finished; - -void GUIRunTime::Pimpl::processEvents() -{ - while(Gnome::Main::instance()->events_pending()) - Gnome::Main::instance()->iteration(FALSE); -} - - -void GUIRunTime::Pimpl::runTime() -{ - XEvent ev; - while (!finished) { - Pimpl::processEvents(); - if (fl_check_forms() == FL_EVENT) { - lyxerr << "LyX: This shouldn't happen..." << endl; - fl_XNextEvent(&ev); - } - } -} diff --git a/src/frontends/gnome/GUIRunTime_pimpl.h b/src/frontends/gnome/GUIRunTime_pimpl.h deleted file mode 100644 index 46b976d22d..0000000000 --- a/src/frontends/gnome/GUIRunTime_pimpl.h +++ /dev/null @@ -1,32 +0,0 @@ -// -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2000 The LyX Team. - * - * @author Jürgen Vigna - * - * ====================================================== */ - -#ifndef GUIRUNTIME_PIMPL_H -#define GUIRUNTIME_PIMPL_H - -#ifdef __GNUG__ -#pragma interface -#endif - -#include "frontends/GUIRunTime.h" - -/* - * The GUI interface for runtime GUI stuff. - */ -struct GUIRunTime::Pimpl { -public: - /// - static void processEvents(); - /// - static void runTime(); -}; -#endif diff --git a/src/frontends/gnome/Makefile.am b/src/frontends/gnome/Makefile.am index 280099b148..b15999872a 100644 --- a/src/frontends/gnome/Makefile.am +++ b/src/frontends/gnome/Makefile.am @@ -32,8 +32,7 @@ LYXDATADIRS = #ETAGS_ARGS = --lang=c++ libgnome_la_SOURCES = \ Dialogs.C \ - GUIRunTime_pimpl.C \ - GUIRunTime_pimpl.h \ + GUIRunTime.C \ FormCopyright.C \ FormCopyright.h \ FormPrint.C \ diff --git a/src/frontends/kde/GUIRunTime.C b/src/frontends/kde/GUIRunTime.C new file mode 100644 index 0000000000..1228e00f96 --- /dev/null +++ b/src/frontends/kde/GUIRunTime.C @@ -0,0 +1,45 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "GUIRunTime.h" +#include "debug.h" + +#include + +#include FORMS_H_LOCATION + +using std::endl; + +extern bool finished; + + +void GUIRunTime::processEvents() +{ + kapp->processEvents(); +} + + +void GUIRunTime::runTime() +{ + // We still use xforms event handler as the main one... + XEvent ev; + while (!finished) { + processEvents(); + if (fl_check_forms() == FL_EVENT) { + lyxerr << "LyX: This shouldn't happen..." << endl; + fl_XNextEvent(&ev); + } + } +} diff --git a/src/frontends/kde/GUIRunTime_pimpl.C b/src/frontends/kde/GUIRunTime_pimpl.C deleted file mode 100644 index bb0afcc921..0000000000 --- a/src/frontends/kde/GUIRunTime_pimpl.C +++ /dev/null @@ -1,48 +0,0 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright (C) 2000 The LyX Team. - * - * @author Jürgen Vigna - * - *======================================================*/ - -#include - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include "GUIRunTime_pimpl.h" -#include "debug.h" - -#include - -#include FORMS_H_LOCATION - -using std::endl; - -extern bool finished; - - -void GUIRunTime::Pimpl::processEvents() -{ - kapp->processEvents(); -} - - -void GUIRunTime::Pimpl::runTime() -{ - // We still use xforms event handler as te main one... - XEvent ev; - while (!finished) { - Pimpl::processEvents(); - if (fl_check_forms() == FL_EVENT) { - lyxerr << "LyX: This shouldn't happen..." << endl; - fl_XNextEvent(&ev); - } - } -} - diff --git a/src/frontends/kde/GUIRunTime_pimpl.h b/src/frontends/kde/GUIRunTime_pimpl.h deleted file mode 100644 index 3d6d0a296a..0000000000 --- a/src/frontends/kde/GUIRunTime_pimpl.h +++ /dev/null @@ -1,32 +0,0 @@ -// -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2000 The LyX Team. - * - * @author Jürgen Vigna - * - * ====================================================== */ - -#ifndef GUIRUNTIME_PIMPL_H -#define GUIRUNTIME_PIMPL_H - -#ifdef __GNUG__ -#pragma interface -#endif - -#include "frontends/GUIRunTime.h" - -/** - The GUI interface for runtime GUI stuff. -*/ -struct GUIRunTime::Pimpl { -public: - /// - static void processEvents(); - /// - static void runTime(); -}; -#endif diff --git a/src/frontends/kde/Makefile.am b/src/frontends/kde/Makefile.am index c6a06c51d5..f2ae6f3b82 100644 --- a/src/frontends/kde/Makefile.am +++ b/src/frontends/kde/Makefile.am @@ -42,8 +42,7 @@ LYXDATADIRS = dlg ETAGS_ARGS = --lang=c++ libkde_la_SOURCES = \ Dialogs.C \ - GUIRunTime_pimpl.C \ - GUIRunTime_pimpl.h \ + GUIRunTime.C \ FormCopyright.C \ FormCopyright.h \ formcopyrightdialog.C \ @@ -79,7 +78,7 @@ dist-hook: # add a dependency for every moc file to be full portable # I've added a key binding to emacs for this. -formcopyrightdialog.C:formcopyrightdialog_moc.C +formcopyrightdialog.C: formcopyrightdialog_moc.C formcopyrightdialog_moc.C: formcopyrightdialog.h $(MOC) formcopyrightdialog.h -o formcopyrightdialog_moc.C diff --git a/src/frontends/xforms/GUIRunTime.C b/src/frontends/xforms/GUIRunTime.C new file mode 100644 index 0000000000..b7763baf4e --- /dev/null +++ b/src/frontends/xforms/GUIRunTime.C @@ -0,0 +1,46 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + *======================================================*/ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include FORMS_H_LOCATION +#include "GUIRunTime.h" +#include "debug.h" + +using std::endl; + +extern bool finished; + + +void GUIRunTime::processEvents() +{ + XEvent ev; + + if (fl_do_forms() == FL_EVENT) { + lyxerr << "LyX: This shouldn't happen..." << endl; + fl_XNextEvent(&ev); + } +} + + +void GUIRunTime::runTime() +{ + XEvent ev; + while (!finished) { + if (fl_check_forms() == FL_EVENT) { + lyxerr << "LyX: This shouldn't appen..." << endl; + fl_XNextEvent(&ev); + } + } +} + diff --git a/src/frontends/xforms/GUIRunTime_pimpl.C b/src/frontends/xforms/GUIRunTime_pimpl.C deleted file mode 100644 index 71911e8263..0000000000 --- a/src/frontends/xforms/GUIRunTime_pimpl.C +++ /dev/null @@ -1,48 +0,0 @@ -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright (C) 2000 The LyX Team. - * - * @author Jürgen Vigna - * - *======================================================*/ - -#include - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include FORMS_H_LOCATION -#include "GUIRunTime_pimpl.h" -#include "debug.h" - -using std::endl; - -extern bool finished; - - -void GUIRunTime::Pimpl::processEvents() -{ - XEvent ev; - - if (fl_do_forms() == FL_EVENT) { - lyxerr << "LyX: This shouldn't happen..." << endl; - fl_XNextEvent(&ev); - } -} - - -void GUIRunTime::Pimpl::runTime() -{ - XEvent ev; - while (!finished) { - if (fl_check_forms() == FL_EVENT) { - lyxerr << "LyX: This shouldn't appen..." << endl; - fl_XNextEvent(&ev); - } - } -} - diff --git a/src/frontends/xforms/GUIRunTime_pimpl.h b/src/frontends/xforms/GUIRunTime_pimpl.h deleted file mode 100644 index 3d6d0a296a..0000000000 --- a/src/frontends/xforms/GUIRunTime_pimpl.h +++ /dev/null @@ -1,32 +0,0 @@ -// -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2000 The LyX Team. - * - * @author Jürgen Vigna - * - * ====================================================== */ - -#ifndef GUIRUNTIME_PIMPL_H -#define GUIRUNTIME_PIMPL_H - -#ifdef __GNUG__ -#pragma interface -#endif - -#include "frontends/GUIRunTime.h" - -/** - The GUI interface for runtime GUI stuff. -*/ -struct GUIRunTime::Pimpl { -public: - /// - static void processEvents(); - /// - static void runTime(); -}; -#endif diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index 7e72aae09c..4f4b415ec1 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -13,8 +13,7 @@ ETAGS_ARGS = --lang=c++ libxforms_la_SOURCES = \ ButtonController.h \ Dialogs.C \ - GUIRunTime_pimpl.C \ - GUIRunTime_pimpl.h \ + GUIRunTime.C \ FormCitation.C \ FormCitation.h \ form_citation.C \ diff --git a/src/lyx_gui.C b/src/lyx_gui.C index f432f5363d..04d4c32f1c 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -564,8 +564,7 @@ void LyXGUI::runTime() { if (!gui) return; - GUIRunTime grt; - grt.runTime(); + GUIRunTime::runTime(); } diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index bbeea7c3db..1379eea4b3 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -201,9 +201,11 @@ void updateAllVisibleBufferRelatedDialogs() if (fd_form_paragraph_extra->form_paragraph_extra->visible) { UpdateParagraphExtra(); } +#ifndef NEW_TABULAR if (fd_form_table_options->form_table_options->visible) { UpdateLayoutTable(1); // just like a right mouse click } +#endif if (fd_form_bullet) { if (fd_form_bullet->form_bullet->visible) { updateBulletForm(); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index b5fed2e3a4..ea555cff61 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -262,10 +262,6 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) lyxerr << "Key [" << action << "][" << buf << "]" -#if 0 - << "[" - << num_bytes << "]" -#endif << endl; } @@ -301,12 +297,7 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state) return 0; } } -#if 0 - else - if (action == LFUN_SELFINSERT) { - argument = s_r[0]; - } -#endif + bool tmp_sc = show_sc; show_sc = false; Dispatch(action, argument.c_str()); diff --git a/src/lyxparagraph.h b/src/lyxparagraph.h index 31589a68bf..b868eb8811 100644 --- a/src/lyxparagraph.h +++ b/src/lyxparagraph.h @@ -39,7 +39,7 @@ class BufferView; // I dare you to try this one too. It is ortogonal with NEW_INSETS so you // can try both or just one of them. -//#define NEW_TABULAR 1 +#define NEW_TABULAR 1 /// A LyXParagraph holds all text, attributes and insets in a text paragraph class LyXParagraph { diff --git a/src/text2.C b/src/text2.C index 9542fc6a3b..f2d5876271 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1376,7 +1376,11 @@ void LyXText::MeltFootnoteEnvironment(BufferView * bview) tmppar->next->MakeSameLayout(cursor.par()); // first the end - if ((!tmppar->GetLayout() && !tmppar->table) + if ((!tmppar->GetLayout() +#ifndef NEW_TABULAR + && !tmppar->table +#endif + ) || (tmppar->Next() && (!tmppar->Next()->Last() || tmppar->Next()->HasSameLayout(tmppar)))) { @@ -1393,7 +1397,11 @@ void LyXText::MeltFootnoteEnvironment(BufferView * bview) /* if there is no space between the text and the footnote, so we insert * a blank * (only if the previous par and the footnotepar are not empty!) */ - if ((!firsttmppar->next->GetLayout() && !firsttmppar->next->table) + if ((!firsttmppar->next->GetLayout() +#ifndef NEW_TABULAR + && !firsttmppar->next->table +#endif + ) || firsttmppar->HasSameLayout(firsttmppar->next)) { if (firsttmppar->size() && !firsttmppar->IsSeparator(firsttmppar->size() - 1)