From eff9b6b7c993861880ef7800f3732b32cf694f57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 22 Aug 2000 18:28:11 +0000 Subject: [PATCH] make NEW_TABULAR default, some GUIRunTime changes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@983 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/WorkArea.C | 2 +- src/frontends/GUIRunTime.C | 43 ------------------- src/frontends/GUIRunTime.h | 28 ++++-------- src/frontends/Makefile.am | 1 - .../{GUIRunTime_pimpl.C => GUIRunTime.C} | 16 +++---- src/frontends/gnome/GUIRunTime_pimpl.h | 32 -------------- src/frontends/gnome/Makefile.am | 3 +- .../kde/{GUIRunTime_pimpl.C => GUIRunTime.C} | 19 ++++---- src/frontends/kde/GUIRunTime_pimpl.h | 32 -------------- src/frontends/kde/Makefile.am | 5 +-- .../{GUIRunTime_pimpl.C => GUIRunTime.C} | 10 ++--- src/frontends/xforms/GUIRunTime_pimpl.h | 32 -------------- src/frontends/xforms/Makefile.am | 3 +- src/lyx_gui.C | 3 +- src/lyx_gui_misc.C | 2 + src/lyxfunc.C | 11 +---- src/lyxparagraph.h | 2 +- src/text2.C | 12 +++++- 18 files changed, 48 insertions(+), 208 deletions(-) delete mode 100644 src/frontends/GUIRunTime.C rename src/frontends/gnome/{GUIRunTime_pimpl.C => GUIRunTime.C} (63%) delete mode 100644 src/frontends/gnome/GUIRunTime_pimpl.h rename src/frontends/kde/{GUIRunTime_pimpl.C => GUIRunTime.C} (57%) delete mode 100644 src/frontends/kde/GUIRunTime_pimpl.h rename src/frontends/xforms/{GUIRunTime_pimpl.C => GUIRunTime.C} (77%) delete mode 100644 src/frontends/xforms/GUIRunTime_pimpl.h 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_pimpl.C b/src/frontends/gnome/GUIRunTime.C similarity index 63% rename from src/frontends/gnome/GUIRunTime_pimpl.C rename to src/frontends/gnome/GUIRunTime.C index 47f615855b..24b53c20d2 100644 --- a/src/frontends/gnome/GUIRunTime_pimpl.C +++ b/src/frontends/gnome/GUIRunTime.C @@ -3,9 +3,7 @@ * * LyX, The Document Processor * - * Copyright (C) 2000 The LyX Team. - * - * @author Jürgen Vigna + * Copyright 2000 The LyX Team. * *======================================================*/ @@ -17,7 +15,7 @@ #include FORMS_H_LOCATION -#include "GUIRunTime_pimpl.h" +#include "GUIRunTime.h" #include "debug.h" #include @@ -26,18 +24,18 @@ using std::endl; extern bool finished; -void GUIRunTime::Pimpl::processEvents() +void GUIRunTime::processEvents() { - while(Gnome::Main::instance()->events_pending()) - Gnome::Main::instance()->iteration(FALSE); + while(Gnome::Main::instance()->events_pending()) + Gnome::Main::instance()->iteration(FALSE); } -void GUIRunTime::Pimpl::runTime() +void GUIRunTime::runTime() { XEvent ev; while (!finished) { - Pimpl::processEvents(); + 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_pimpl.C b/src/frontends/kde/GUIRunTime.C similarity index 57% rename from src/frontends/kde/GUIRunTime_pimpl.C rename to src/frontends/kde/GUIRunTime.C index bb0afcc921..1228e00f96 100644 --- a/src/frontends/kde/GUIRunTime_pimpl.C +++ b/src/frontends/kde/GUIRunTime.C @@ -3,11 +3,9 @@ * * LyX, The Document Processor * - * Copyright (C) 2000 The LyX Team. + * Copyright 2000 The LyX Team. * - * @author Jürgen Vigna - * - *======================================================*/ + * ====================================================== */ #include @@ -15,7 +13,7 @@ #pragma implementation #endif -#include "GUIRunTime_pimpl.h" +#include "GUIRunTime.h" #include "debug.h" #include @@ -27,22 +25,21 @@ using std::endl; extern bool finished; -void GUIRunTime::Pimpl::processEvents() +void GUIRunTime::processEvents() { - kapp->processEvents(); + kapp->processEvents(); } -void GUIRunTime::Pimpl::runTime() +void GUIRunTime::runTime() { - // We still use xforms event handler as te main one... + // We still use xforms event handler as the main one... XEvent ev; while (!finished) { - Pimpl::processEvents(); + 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_pimpl.C b/src/frontends/xforms/GUIRunTime.C similarity index 77% rename from src/frontends/xforms/GUIRunTime_pimpl.C rename to src/frontends/xforms/GUIRunTime.C index 71911e8263..b7763baf4e 100644 --- a/src/frontends/xforms/GUIRunTime_pimpl.C +++ b/src/frontends/xforms/GUIRunTime.C @@ -3,9 +3,7 @@ * * LyX, The Document Processor * - * Copyright (C) 2000 The LyX Team. - * - * @author Jürgen Vigna + * Copyright 2000 The LyX Team. * *======================================================*/ @@ -16,7 +14,7 @@ #endif #include FORMS_H_LOCATION -#include "GUIRunTime_pimpl.h" +#include "GUIRunTime.h" #include "debug.h" using std::endl; @@ -24,7 +22,7 @@ using std::endl; extern bool finished; -void GUIRunTime::Pimpl::processEvents() +void GUIRunTime::processEvents() { XEvent ev; @@ -35,7 +33,7 @@ void GUIRunTime::Pimpl::processEvents() } -void GUIRunTime::Pimpl::runTime() +void GUIRunTime::runTime() { XEvent ev; while (!finished) { 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) -- 2.39.2