]> git.lyx.org Git - features.git/commitdiff
Some forgotten files and Anguses citation patch.
authorJürgen Vigna <jug@sad.it>
Fri, 14 Jul 2000 07:52:03 +0000 (07:52 +0000)
committerJürgen Vigna <jug@sad.it>
Fri, 14 Jul 2000 07:52:03 +0000 (07:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@882 a592a061-630c-0410-9148-cb99ea01b6c8

25 files changed:
ChangeLog
lib/listerrors [new file with mode: 0755]
src/BufferView_pimpl.C
src/frontends/Dialogs.h
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCitation.h
src/frontends/xforms/form_citation.h
src/frontends/xforms/form_copyright.h
src/frontends/xforms/form_preferences.h
src/frontends/xforms/form_print.h
src/frontends/xforms/form_tabular.h
src/frontends/xforms/forms/fdfixh.sed [new file with mode: 0644]
src/insets/insetcite.C
src/insets/insetcite.h
src/insets/insetloa.C
src/insets/insetloa.h
src/insets/insetlof.C
src/insets/insetlof.h
src/insets/insetlot.C
src/insets/insetlot.h
src/insets/insetparent.C
src/insets/insetparent.h
src/insets/insettoc.C
src/insets/insettoc.h
src/insets/lyxinset.h

index e1146d8d1d1562578077c742e08002f5a8e90cbd..c90e1d00e2414151cc59a2220a88fcaad9bdf88a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-07-13  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * src/frontends/Dialogs.h (hideCitation) : new signal to prevent
+       crashes when closing dialog to a deleted inset.
+
+       * src/insets/insetcite.[Ch] (Edit) : the return of this former
+       method! Now similar to other insets.
+
 2000-07-13  Juergen Vigna  <jug@sad.it>
 
        * src/text.C (GetVisibleRow): fixed clearing of rows with insets!
diff --git a/lib/listerrors b/lib/listerrors
new file mode 100755 (executable)
index 0000000..ce26210
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+echo "This is NOT the listerrors program."
+echo ""
+echo "Here was the problem when we tried to build listerrors:"
+echo The NOWEB notangle was not found.
index f9082ab94e1cbd82a138841eadca79268e64eb0c..aad1957478cf1178f350ee8aa44bbe621536c278 100644 (file)
@@ -27,7 +27,6 @@
 #include "intl.h"
 #include "support/LAssert.h"
 #include "frontends/Dialogs.h"
-#include "insets/insetcite.h"
 
 #ifdef SIGC_CXX_NAMESPACES
 using SigC::slot;
@@ -790,18 +789,7 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y,
                        inset->InsetButtonRelease(bv_, x, y, button);
                } else {
                        inset_hit->InsetButtonRelease(bv_, x, y, button);
-
-                       switch( inset_hit->LyxCode() ) {
-                       case Inset::CITATION_CODE:
-                       {
-                               owner_->getDialogs()->
-                                       showCitation( (InsetCitation *)inset_hit );
-                       }
-                       break;
-                       default:
-                               inset_hit->Edit(bv_, x, y, button);
-                       break;
-                       }
+                       inset_hit->Edit(bv_, x, y, button);
                }
                return;
        }
index 07bd1b480ca78acc8c4629991694898ef4693d39..5fe2a6b392dc6c9202731a2d171597afe05c13dc 100644 (file)
@@ -113,6 +113,8 @@ public:
        ///
        Signal1<void, string const &> createCitation;
        ///
+       Signal1<void, InsetCitation *> hideCitation;
+       ///
        Signal1<void, InsetBibtex *> showBibtex;
        ///
        Signal1<void, InsetInfo *> showInfo;
index ba7462db1d73520fb4ac00cd452c61d5d93c6454..fac2d3b8c032db54bbd144f071d1899901c51f50 100644 (file)
@@ -48,6 +48,7 @@ FormCitation::FormCitation(LyXView * lv, Dialogs * d)
        // storing a copy because we won't be disconnecting.
        d->showCitation.connect(slot(this, &FormCitation::showInset));
        d->createCitation.connect(slot(this, &FormCitation::createInset));
+       d->hideCitation.connect(slot(this, &FormCitation::hideInset));
 }
 
 
@@ -93,6 +94,15 @@ void FormCitation::createInset( string const & arg )
 }
 
 
+void FormCitation::hideInset(InsetCitation * ti)
+{
+       if (inset_ == ti) {
+               inset_ = 0;
+               hide();
+       }
+}
+
+
 void FormCitation::show()
 {
        if (!dialog_) {
@@ -134,6 +144,8 @@ void FormCitation::update()
 
        blist.clear();
 
+       fl_freeze_form( dialog_->form_citation );
+
        updateBrowser( dialog_->bibBrsr, bibkeys );
        updateBrowser( dialog_->citeBrsr, citekeys );
        fl_clear_browser( dialog_->infoBrsr );
@@ -153,6 +165,8 @@ void FormCitation::update()
        setSize( size, bibPresent );
 
        fl_set_input( dialog_->textAftr, textAfter.c_str() );
+
+       fl_unfreeze_form( dialog_->form_citation );
 }
 
 
@@ -175,10 +189,8 @@ void FormCitation::updateBrowser( FL_OBJECT * browser,
 {
        fl_clear_browser( browser );
 
-       fl_freeze_form( browser->form );
        for( unsigned int i = 0; i < keys.size(); ++i )
                fl_add_browser_line( browser, keys[i].c_str() );
-       fl_unfreeze_form( browser->form );
 }
 
 
@@ -291,7 +303,8 @@ void FormCitation::setSize( int brsrHeight, bool bibPresent ) const
        // awaiting natbib support
        fl_hide_object( dialog_->textBefore );
 
-       fl_set_object_geometry( dialog_->textAftr, 100, ypos,   250, 30 );
+       fl_set_object_position(dialog_->textAftr, 100, ypos);
+//     fl_set_object_geometry( dialog_->textAftr, 100, ypos,   250, 30 );
        fl_set_object_geometry( dialog_->ok,       230, ypos+50, 90, 30 );
        fl_set_object_geometry( dialog_->cancel,   330, ypos+50, 90, 30 );
 }
index 7d55579d43d49e57bd3f48f821ab280842b15d2e..57ea8a85c55ba6e7dfbb15389e35e70750c51055 100644 (file)
 #include "DialogBase.h"
 #include "LString.h"
 #include <vector>
-#include "form_citation.h"
 
 class Dialogs;
 // same arguement as in Dialogs.h s/LyX/UI/
 class LyXView;
 class InsetCitation;
+struct FD_form_citation;
 
 /** This class provides an XForms implementation of the FormCitation Dialog.
  */
@@ -64,6 +64,8 @@ private:
        /// 
        void showInset( InsetCitation * );
        /// 
+       void hideInset( InsetCitation * );
+       /// 
        void show();
        /// Hide the dialog.
        void hide();
index 2137d2c09a169dd1547a7994d40486601dc63b81..3176997c668ee40c51ef130e1e73a313253ff92a 100644 (file)
@@ -1,4 +1,4 @@
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
 
 #ifndef FD_form_citation_h_
 #define FD_form_citation_h_
index fc1977bd06ddf97b2e3c874fb36edda3401888bf..3c70c88d5205c2b85eece5a22bab3355411fb635 100644 (file)
@@ -1,4 +1,4 @@
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
 
 #ifndef FD_form_copyright_h_
 #define FD_form_copyright_h_
index 1abb4c2012d69603e34927ab01a943704f9109ab..a419617a0f0561f1f86f862e8c39caf3faeb9cf7 100644 (file)
@@ -1,4 +1,4 @@
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
 
 #ifndef FD_form_bind_h_
 #define FD_form_bind_h_
index 04857d54362ef3b767bbf8d6dbe5aedb4d725601..c8461fd8f1e7db44aa56acfd31c595ebb1c49dab 100644 (file)
@@ -1,4 +1,4 @@
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
 
 #ifndef FD_form_print_h_
 #define FD_form_print_h_
index 7dbd0cfd693f4acdc92d1b0f3ee2e9c7493af2c4..d675a3d1fdc6b4ff613566bf75ee97729d54bb59 100644 (file)
@@ -1,4 +1,4 @@
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
 
 #ifndef FD_form_tabular_h_
 #define FD_form_tabular_h_
diff --git a/src/frontends/xforms/forms/fdfixh.sed b/src/frontends/xforms/forms/fdfixh.sed
new file mode 100644 (file)
index 0000000..354d07a
--- /dev/null
@@ -0,0 +1,52 @@
+# cat someFile.h | sed -f fdfixh.sed
+
+# It contains the instructions that sed requires to manipulate
+# the header files produced by fdesign into a form usable by LyX
+
+# In summary it...
+
+# s/\(extern \)\(.*\)/\1 "C" \2/
+#
+#  Replaces lines such as "extern void func(args);"
+#  with "extern "C" void func(args);"
+
+# /create_form_/d
+#
+#  Deletes lines containing "/create_form_/d"
+
+# Rewrites                        as
+# typedef struct {                struct someStruct {
+#        ...                              ...
+#        void *vdata;                     ...
+#        char *cdata;             };
+#        long  ldata;
+#        ...
+# } someStruct;
+#
+# This is detailed more closely below 
+
+s/\(extern \)\(.*\)/\1 "C" \2/
+/create_form_/d
+
+/typedef struct {/,/} .*;/{  
+# delete lines containing ...
+/typedef struct {/d
+/vdata/d
+/cdata/d
+/ldata/d
+
+# copy remaining lines into the hold space
+H
+
+# rewrite "} someStruct;" as "struct someStruct {" and print
+s/} \(.*\);/struct \1 {/p
+
+# delete line from pattern space
+d
+}
+# swap the hold space back into the pattern space and...
+/^$/x
+{
+# rewrite "} someStruct;" as "};"
+s/} \(.*\);/};/
+}
index 13ec3a2d0e5ce08a122a35185ecb021b1ef15efb..9f31ae2186234769310c7ce4f2a0a838704f2989 100644 (file)
 #endif
 
 #include "insetcite.h"
+#include "LyXView.h"
+#include "BufferView.h"
+#include "frontends/Dialogs.h"
 
 InsetCitation::InsetCitation(string const & key, string const & note)
-               : InsetCommand("cite", key, note)
+               : InsetCommand("cite", key, note), dialogs_(0)
 {
 }
 
+InsetCitation::~InsetCitation()
+{
+       if( dialogs_ != 0 )
+               dialogs_->hideCitation( this );
+}
+
 string InsetCitation::getScreenLabel() const
 {
        string temp("[");
@@ -33,3 +42,10 @@ string InsetCitation::getScreenLabel() const
 
        return temp + ']';
 }
+
+void InsetCitation::Edit(BufferView * bv, int, int, unsigned int)
+{
+       dialogs_ = bv->owner()->getDialogs();
+       dialogs_->showCitation( this );
+}
+
index 92bb90f3f2e78cd37e8454eb572b6f14b67dedf8..3aa04702abf3d7530f2986453ca73b6465278055 100644 (file)
@@ -16,6 +16,7 @@
 #endif
 
 #include "insetcommand.h"
+class Dialogs;
 
 /** Used to insert citations  
  */
@@ -25,18 +26,22 @@ public:
        explicit
        InsetCitation(string const & key, string const & note = string());
        ///
+       ~InsetCitation();
+       ///
        Inset * Clone() const {
                return new InsetCitation(getContents(), getOptions());
        }
        ///
        string getScreenLabel() const;
        ///
-       Code LyxCode() const { return CITATION_CODE; }
-       ///
        EDITABLE Editable() const { return IS_EDITABLE; }
+        ///
+       void Edit(BufferView *, int, int, unsigned int);
 private:
        ///
-       InsetCitation() : InsetCommand("cite") {}
+       InsetCitation() : InsetCommand("cite"), dialogs_(0) {}
+       ///
+       Dialogs * dialogs_;
 };
 
 #endif // INSET_CITE_H
index bb3ef255bd2f9c67a210e797c439cfd630c7b76e..65215ad2abcaedb827da65a7d432c009c2d3754e 100644 (file)
@@ -17,6 +17,7 @@
 #pragma implementation
 #endif
 
+#include "gettext.h"
 #include "insetloa.h"
 #include "LaTeXFeatures.h"
 #include "BufferView.h"
index 48617ea2963033c66ad7ec265428d171ce949340..f16bbfcc48b51684bdd16aabf6d193a09ecf0e3c 100644 (file)
@@ -17,7 +17,6 @@
 #endif
 
 #include "insetcommand.h"
-#include "gettext.h"
 
 class Buffer;
 
index d3555ca8af4d3a30daf33a4e6400f705bcea63b6..12705e0f85db8a499ed3b621ca3c6b393dc991e6 100644 (file)
@@ -4,6 +4,7 @@
 #pragma implementation
 #endif
 
+#include "gettext.h"
 #include "insetlof.h"
 #include "BufferView.h"
 #include "LyXView.h"
index e4b19888f94517cf824156fcd07f7cafc4522d80..10836c8bc1d541701325b6c073907296bf7e8420 100644 (file)
@@ -13,7 +13,6 @@
 #define INSET_LOF_H
 
 #include "insetcommand.h"
-#include "gettext.h"
 
 // Created by Lgb 970527
 
index d683ead381a2b9d380b828edb1fc188b629ef8df..f4a1e3b0459c1cd79a343ffc87d988731e498dac 100644 (file)
@@ -4,6 +4,7 @@
 #pragma implementation
 #endif
 
+#include "gettext.h"
 #include "insetlot.h"
 #include "BufferView.h"
 #include "LyXView.h"
index 7b48da75773a6750452e66a5d16b117503f92325..6ef73b4a946cdb0049df12acb677248fe2a62634 100644 (file)
@@ -17,7 +17,6 @@
 #endif
 
 #include "insetcommand.h"
-#include "gettext.h"
 
 // Created by Lgb 970527
 
index 71fc512398487e6a97bc2f918ec8dd1810c08008..fb65bdcb225da3b1fad39e7c5de3fbad90450fbd 100644 (file)
@@ -24,6 +24,7 @@
 #include "lyxfunc.h"
 #include "commandtags.h"
 #include "buffer.h"
+#include "gettext.h"
 
 using std::ostream;
 
index 59d77d7a1c5ffcfbda1e31da729fea2c6da49705..48bccbd0f071faf01c8812c6f27e5def8f17195b 100644 (file)
@@ -16,7 +16,6 @@
 #endif
 
 #include "insetcommand.h"
-#include "gettext.h"
 
 class Buffer;
 
index 15414fb8f854f287d079bc5475a17069a3153fad..a30456235d717bd233a8708d1ceec6a79c2a202a 100644 (file)
@@ -4,6 +4,7 @@
 #pragma implementation
 #endif
 
+#include "gettext.h"
 #include "insettoc.h"
 #include "commandtags.h"
 #include "lyxfunc.h"
index aed9460393404411ed29cb7c44e00ab4767f7893..c96c6266a191d6e2bbd4842d1bf3824f2b9361eb 100644 (file)
@@ -17,7 +17,6 @@
 #endif
 
 #include "insetcommand.h"
-#include "gettext.h"
 
 class Buffer;
 
index 5e244dd31bcd0ee3b43b71cf30e87532a77c2317..1a190f2b69c265da4f19cba6de2da77319e9bdfb 100644 (file)
@@ -102,8 +102,6 @@ public:
                ///
                EXTERNAL_CODE,
                ///
-               CITATION_CODE,
-               ///
                THEOREM_CODE
        };