]> git.lyx.org Git - lyx.git/commitdiff
Finish to add wrappers for xforms callbacks. Now dec C++ 6.1 compiles lyx
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 25 Oct 1999 14:18:30 +0000 (14:18 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 25 Oct 1999 14:18:30 +0000 (14:18 +0000)
happily :)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@242 a592a061-630c-0410-9148-cb99ea01b6c8

22 files changed:
ChangeLog
INSTALL
src/BufferView.C
src/BufferView.h
src/LyXView.C
src/LyXView.h
src/combox.C
src/combox.h
src/filedlg.C
src/filedlg.h
src/intl.C
src/intl.h
src/lyxserver.C
src/lyxserver.h
src/lyxvc.C
src/lyxvc.h
src/menus.C
src/menus.h
src/minibuffer.C
src/minibuffer.h
src/toolbar.C
src/toolbar.h

index 9fb256b001c1fcd8142d3b91caeb7d97c6dda3fe..9e366e9c20218aaebb890b5e3c4b73dbae4171f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 1999-10-25  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
+       * INSTALL: it is now possible to compile LyX with digital C++ 6.1
+       (and presumably 6.2).
+
+       * src/{BufferView,LyXView,combox,filedlg,intl,lyxserver,lyxvc,
+       menus,minibuffer,toolbar}.{C,h}: added C_xxx wrappers around
+       remaining static member callbacks. 
+
        * src/lyxfunc.C (Dispatch): Use _() instead of N_() fot minibuffer
        messages. 
 
diff --git a/INSTALL b/INSTALL
index 5ec5fa5910c80f773cd0e6d2e745f7ac06846655..f9048236aac000f89984b35d5e9bae642f3adf50 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -278,6 +278,16 @@ notify us.
     will be solved if you use --with-included-gettext when configuring
     LyX.
 
+  o It is possible to compile lyx with Digital Unix cxx compiler
+    version 6.1 (and presumably compaq C++ 6.2 on both Tru64 unix and
+    linux/alpha, when this will be available), provided one uses
+       CXX=cxx
+       CXXFLAGS='-ptr /tmp/lyx_cxx_repository -std strict_ansi -g -O'
+
+    Note that this will not work when compiling directly from the cvs
+    repository, due to the tricks used by automake for dependencies. Ask
+    Jean-Marc.Lasgouttes@inria.fr for a workaround.
+
   o On Digital Unix with cxx, you may have a compilation error in
     lyx_main.C if you have GNU gettext installed. This is due to a bug
     in gettext. To solve this, you can either (1) configure with
@@ -381,8 +391,3 @@ Warning: Linking some objects which contain exception information sections
 
     You can safely ignore it. 
 
-  o Configure fails to work with cxx V5.0-3 on Digital Unix
-    V3.2c.  This is due to a bug in this particular version of cxx. 
-    Contact Achim Bohnet <ach@rosat.mpe-garching.mpg.de> for more
-    details concerning this problem.
-
index f0351879f82a445b7963ccc1672368a431edc401..2aa07c8936de694b444f51b19d9b496e4f4db958 100644 (file)
@@ -364,6 +364,29 @@ void BufferView::gotoError()
                _buffer->text->cursor;
 }
 
+// Just a bunch of C wrappers around static members of BufferView
+extern "C" void C_BufferView_UpCB(FL_OBJECT *ob, long buf) {
+       BufferView::UpCB(ob,buf);
+}
+
+extern "C" void C_BufferView_DownCB(FL_OBJECT *ob, long buf) {
+       BufferView::DownCB(ob,buf);
+}
+
+extern "C" void C_BufferView_ScrollCB(FL_OBJECT *ob, long buf) {
+       BufferView::ScrollCB(ob,buf);
+}
+
+extern "C" void C_BufferView_CursorToggleCB(FL_OBJECT *ob, long buf) {
+       BufferView::CursorToggleCB(ob,buf);
+}
+
+extern "C" int C_BufferView_work_area_handler(FL_OBJECT *ob, int event,
+                                             FL_Coord, FL_Coord, 
+                                             int key, void *xev) {
+       return BufferView::work_area_handler(ob, event, 0, 0, key, xev);
+}
+
 
 void BufferView::create_view(int xpos, int ypos, int width, int height)
 {
@@ -392,7 +415,7 @@ void BufferView::create_view(int xpos, int ypos, int width, int height)
                                      xpos +bw, ypos+bw,
                                      width-15-2*bw /* scrollbarwidth */,
                                      height-2*bw,"",
-                                     work_area_handler);
+                                     C_BufferView_work_area_handler);
        obj->wantkey = FL_KEY_TAB;
        obj->u_vdata = this; /* This is how we pass the BufferView
                                       to the work_area_handler. */
@@ -418,7 +441,7 @@ void BufferView::create_view(int xpos, int ypos, int width, int height)
        fl_set_object_color(obj,FL_MCOL,FL_BLUE);
        fl_set_object_resize(obj, FL_RESIZE_ALL);
        fl_set_object_gravity(obj,NorthEastGravity, NorthEastGravity);
-       fl_set_object_callback(obj,UpCB,(long)this);
+       fl_set_object_callback(obj,C_BufferView_UpCB,(long)this);
        fl_set_pixmapbutton_data(obj, up_xpm);
 
 #if FL_REVISION >85
@@ -436,7 +459,7 @@ void BufferView::create_view(int xpos, int ypos, int width, int height)
        fl_set_object_boxtype(obj, FL_UP_BOX);
        fl_set_object_resize(obj, FL_RESIZE_ALL);
        fl_set_object_gravity(obj, NorthEastGravity, SouthEastGravity);
-       fl_set_object_callback(obj,ScrollCB,(long)this);
+       fl_set_object_callback(obj,C_BufferView_ScrollCB,(long)this);
        
        // down - scrollbar button
 #if FL_REVISION > 85
@@ -452,7 +475,7 @@ void BufferView::create_view(int xpos, int ypos, int width, int height)
        fl_set_object_color(obj,FL_MCOL,FL_BLUE);
        fl_set_object_resize(obj, FL_RESIZE_ALL);
        fl_set_object_gravity(obj, SouthEastGravity, SouthEastGravity);
-       fl_set_object_callback(obj,DownCB,(long)this);
+       fl_set_object_callback(obj,C_BufferView_DownCB,(long)this);
        fl_set_pixmapbutton_data(obj, down_xpm);
        fl_set_border_width(-bw);
 
@@ -468,7 +491,7 @@ void BufferView::create_view(int xpos, int ypos, int width, int height)
        // timer_cursor
        timer_cursor = obj = fl_add_timer(FL_HIDDEN_TIMER,
                                          0,0,0,0,"Timer");
-       fl_set_object_callback(obj,CursorToggleCB,0);
+       fl_set_object_callback(obj,C_BufferView_CursorToggleCB,0);
        obj->u_vdata = this;
 }
 
index 64a2c0d550cc5f72540a22ae17689c85bb9e8665..25157ba3253a4d4cee63094c9e57b834be719fbc 100644 (file)
@@ -89,6 +89,7 @@ private:
        ///
        void ScrollDownOnePage(long /*time*/);
 
+public:
        /// A callback for the up arrow in the scrollbar.
        static void UpCB(FL_OBJECT *ob, long);
 
@@ -98,10 +99,13 @@ private:
        /// A callback for the down arrow in the scrollbar.
        static void DownCB(FL_OBJECT *ob, long);
 
+       ///
+       static void CursorToggleCB(FL_OBJECT *ob, long);
        /** Work area free object handler
         */
        static int work_area_handler(FL_OBJECT *, int event,
                                     FL_Coord, FL_Coord, int key, void *xev);
+private:
        ///
        int WorkAreaMotionNotify(FL_OBJECT *ob,
                                 Window win,
@@ -122,8 +126,6 @@ private:
                                  int w, int h,
                                  XEvent *ev, void *d);
        ///
-       static void CursorToggleCB(FL_OBJECT *ob, long);
-       ///
        LyXView *_owner;
        ///
        Buffer *_buffer;
index 39ed8dc8d0866dff74c2064b59e011f82134cfad..b9b600c831ceb35686e4e360feb83ee205cdd072 100644 (file)
@@ -46,11 +46,12 @@ int current_layout = 0;
 // This is very temporary
 BufferView *current_view;
 
+extern "C" int C_LyXView_atCloseMainFormCB(FL_FORM *, void *);
 
 LyXView::LyXView(int width, int height)
 {
        fd_form_main = create_form_form_main(width,height);
-       fl_set_form_atclose(_form, atCloseMainFormCB, 0);
+       fl_set_form_atclose(_form, C_LyXView_atCloseMainFormCB, 0);
        lyxerr.debug() << "Initializing LyXFunc" << endl;
        lyxfunc = new LyXFunc(this);
        intl = new Intl;
@@ -91,6 +92,12 @@ void LyXView::UpdateTimerCB(FL_OBJECT *ob, long)
        updatetimer = 0;
 }
 
+// Wrapper for the above
+extern "C" void C_LyXView_UpdateTimerCB(FL_OBJECT *ob, long data) {
+       LyXView::UpdateTimerCB(ob,data);
+}
+
+
 
 // Callback for autosave timer
 void LyXView::AutosaveTimerCB(FL_OBJECT *, long)
@@ -99,6 +106,11 @@ void LyXView::AutosaveTimerCB(FL_OBJECT *, long)
        AutoSave();
 }
 
+// Wrapper for the above
+extern "C" void C_LyXView_AutosaveTimerCB(FL_OBJECT *ob, long data) {
+       LyXView::AutosaveTimerCB(ob, data);
+}
+
 
 /// Reset autosave timer
 void LyXView::resetAutosaveTimer()
@@ -115,6 +127,11 @@ int LyXView::atCloseMainFormCB(FL_FORM *, void *)
        return FL_IGNORE;
 }
 
+// Wrapper for the above
+extern "C" int C_LyXView_atCloseMainFormCB(FL_FORM *form, void *p) {
+       return LyXView::atCloseMainFormCB(form,p);
+}
+
 
 void LyXView::setPosition(int x, int y)
 {
@@ -198,12 +215,12 @@ FD_form_main *LyXView::create_form_form_main(int width, int height)
        // timer_autosave
        fdui->timer_autosave = obj = fl_add_timer(FL_HIDDEN_TIMER,
                                                  0,0,0,0,"Timer");
-       fl_set_object_callback(obj,AutosaveTimerCB,0);
+       fl_set_object_callback(obj,C_LyXView_AutosaveTimerCB,0);
        
        // timer_update
        fdui->timer_update = obj = fl_add_timer(FL_HIDDEN_TIMER,
                                                0,0,0,0,"Timer");
-       fl_set_object_callback(obj,UpdateTimerCB,0);
+       fl_set_object_callback(obj,C_LyXView_UpdateTimerCB,0);
        obj->u_vdata = (void*) this;
 
        //
@@ -231,6 +248,7 @@ FD_form_main *LyXView::create_form_form_main(int width, int height)
        return fdui;
 }
 
+extern "C" int C_LyXView_KeyPressMask_raw_callback(FL_FORM *fl, void *xev);
 
 void LyXView::init()
 {
@@ -247,7 +265,7 @@ void LyXView::init()
        // Install the raw callback for keyboard events 
        fl_register_raw_callback(_form,
                                 KeyPressMask,
-                                KeyPressMask_raw_callback);
+                                C_LyXView_KeyPressMask_raw_callback);
         intl->InitKeyMapper(lyxrc->use_kbmap);
 }
 
@@ -333,6 +351,11 @@ int LyXView::KeyPressMask_raw_callback(FL_FORM *fl, void *xev)
        return retval;
 }
 
+// wrapper for the above
+extern "C" int C_LyXView_KeyPressMask_raw_callback(FL_FORM *fl, void *xev)
+{
+       return LyXView::KeyPressMask_raw_callback(fl, xev);
+}
 
 // Updates the title of the window with the filename of the current document
 void LyXView::updateWindowTitle() {
index 8bc0463db88ecd2db857b72a94bd0a301ecb58e0..94f46f676d372af5da7e0d98f07d54d398177fe4 100644 (file)
@@ -119,11 +119,9 @@ private:
        void invalidateLayoutChoice();
        ///
        void UpdateDocumentClassChoice();
+public:
        ///
        static int KeyPressMask_raw_callback(FL_FORM *, void *xev);
-       /// makes the main form.
-       FD_form_main *create_form_form_main(int width, int height);
-
        /** This callback is run when a close event is sent from the
          window manager. */
        static int atCloseMainFormCB(FL_FORM *, void *);
@@ -131,6 +129,9 @@ private:
        static void AutosaveTimerCB(FL_OBJECT *, long);
        /// A callback
        static void UpdateTimerCB(FL_OBJECT *, long);
+private:
+       /// makes the main form.
+       FD_form_main *create_form_form_main(int width, int height);
        /// A pointer to the form.      
        FD_form_main *_form_main;
        /// A pointer to the form.      
index 2dcffc9743eeb4d11f74c73ff828ea6dcd0499c2..f51f700c676a26e7d9ceb1f48eaa1b038319797a 100644 (file)
 
 #include "debug.h"
 
+// These are C wrappers around static members of Combox, used as
+// callbacks for xforms.
+extern "C" void C_Combox_input_cb(FL_OBJECT *ob, long);
+extern "C" void C_Combox_combo_cb(FL_OBJECT *ob, long data) ;
+extern "C" int C_Combox_peek_event(FL_FORM * form, void *xev);
+
 Combox::Combox(combox_type t): type(t)
 {
    browser = button = 0;
@@ -156,13 +162,13 @@ void Combox::add(int x, int y, int w, int hmin, int hmax)
                                             x+w-22,y,22,hmin,"@2->");
                fl_set_object_color(obj,FL_MCOL, FL_MCOL);
                fl_set_object_dblbuffer(obj, 1);
-               fl_set_object_callback(obj,combo_cb,0);
+               fl_set_object_callback(obj,C_Combox_combo_cb,0);
                label = obj = fl_add_button(FL_NORMAL_TEXT,x,y,w-22,hmin,"");
                fl_set_object_boxtype(obj,FL_DOWN_BOX);
                fl_set_object_color(obj,FL_MCOL,FL_BLACK);
                fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
                fl_set_object_dblbuffer(obj, 1);
-               fl_set_object_callback(obj,combo_cb,0);
+               fl_set_object_callback(obj,C_Combox_combo_cb,0);
                break;
        }
        case FL_COMBOX_NORMAL:
@@ -170,7 +176,7 @@ void Combox::add(int x, int y, int w, int hmin, int hmax)
                button = obj = fl_add_button(FL_NORMAL_BUTTON,x,y,w,hmin,"");
                fl_set_object_color(obj,FL_MCOL, FL_MCOL);
                fl_set_object_boxtype(obj,FL_DOWN_BOX);
-               fl_set_object_callback(obj,combo_cb,0);
+               fl_set_object_callback(obj,C_Combox_combo_cb,0);
                fl_set_object_color(obj,FL_MCOL,FL_BLACK);
                label = button;
                break;
@@ -180,11 +186,11 @@ void Combox::add(int x, int y, int w, int hmin, int hmax)
                button = obj = fl_add_button(FL_NORMAL_BUTTON,
                                             x+w-22,y,22,hmin,"@2->");
                fl_set_object_color(obj,FL_MCOL, FL_MCOL);
-               fl_set_object_callback(obj,combo_cb,0);
+               fl_set_object_callback(obj,C_Combox_combo_cb,0);
                label = obj = fl_add_input(FL_NORMAL_INPUT,x,y,w-22,hmin,"");
                fl_set_object_boxtype(obj,FL_DOWN_BOX);
                fl_set_object_return(obj, FL_RETURN_END_CHANGED);
-               fl_set_object_callback(obj,input_cb,0);
+               fl_set_object_callback(obj,C_Combox_input_cb,0);
                //fl_set_object_color(obj,FL_MCOL,FL_BLACK);
                //fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
                break;
@@ -208,11 +214,13 @@ void Combox::add(int x, int y, int w, int hmin, int hmax)
        fl_set_object_boxtype(obj,FL_UP_BOX);
        fl_set_object_color(obj,FL_MCOL, FL_YELLOW);
        fl_set_object_gravity(obj, NorthWestGravity, NorthWestGravity);
-       fl_set_object_callback(obj,combo_cb,2);
+       fl_set_object_callback(obj,C_Combox_combo_cb,2);
        fl_end_form();
        browser->u_vdata = (void*)this;
        form->u_vdata = browser;
-       fl_register_raw_callback(form, ButtonPressMask|KeyPressMask,peek_event);
+       fl_register_raw_callback(form, 
+                                ButtonPressMask|KeyPressMask,
+                                C_Combox_peek_event);
 
        // And revert to adding to the old form (Asger)
        fl_addto_form(current_form);
@@ -309,6 +317,11 @@ void Combox::input_cb(FL_OBJECT *ob, long)
        combo->is_empty = false;
 }
 
+extern "C" void C_Combox_input_cb(FL_OBJECT *ob, long data)
+{
+  Combox::input_cb(ob, data);
+}
+
 
 void Combox::combo_cb(FL_OBJECT *ob, long data)
 {
@@ -344,6 +357,11 @@ void Combox::combo_cb(FL_OBJECT *ob, long data)
        }
 }
 
+extern "C" void C_Combox_combo_cb(FL_OBJECT *ob, long data) 
+{
+       Combox::combo_cb(ob,data);
+}
+
 
 int Combox::peek_event(FL_FORM * form, void *xev)
 {
@@ -416,6 +434,11 @@ int Combox::peek_event(FL_FORM * form, void *xev)
        return 0;  
 }
        
+extern "C" int C_Combox_peek_event(FL_FORM * form, void *xev)
+{
+       return Combox::peek_event(form, xev);
+}
+
 
 #ifdef TESTCOMBO
 typedef struct {
index a4ff82a76e42f339b9c2373d1e13468b1a095c59..0dfc461a27ae6710a77f9036c81e291440e1c88c 100644 (file)
@@ -107,6 +107,12 @@ public:
        void Redraw();
        ///
        void Show();
+       ///
+       static void combo_cb(FL_OBJECT *, long);
+       ///
+       static void input_cb(FL_OBJECT *, long);
+       ///
+        static int  peek_event(FL_FORM *, void *);
  protected:
         /// At least Hide should not be public
        void Hide(int who = 0);
@@ -122,12 +128,6 @@ public:
        ///
        bool is_empty;
        ///
-       static void combo_cb(FL_OBJECT *, long);
-       ///
-       static void input_cb(FL_OBJECT *, long);
-       ///
-        static int  peek_event(FL_FORM *, void *);
-       ///
        FL_COMBO_CB callback;
        ///
        void *cb_arg;
index d8b732be83ae7d23a57cd549fcc311d451dee5a8..bbd63ba7ed6809cf7285ec94dc8b5752fe18c739 100644 (file)
@@ -75,6 +75,12 @@ static const long ONE_HOUR_SEC = 60L * 60L;
 // global instance (user cache root)
 UserCache lyxUserCache = UserCache(string(),0,0);
 
+// some "C" wrappers around callbacks
+extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT *, long lArgument);
+extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT *, long);
+extern "C" int C_LyXFileDlg_CancelCB(FL_FORM *, void *);
+extern "C" int C_LyXDirEntryC_ldeCompProc(const void* r1, 
+                                         const void* r2);
 
 // Add: creates a new user entry
 UserCache * UserCache::Add(uid_t ID)
@@ -196,6 +202,13 @@ int LyXDirEntry::ldeCompProc(const LyXDirEntry * r1,
        return r1->pszName.compare(r2->pszName);
 }
 
+extern "C" int C_LyXDirEntry_ldeCompProc(const void * r1, 
+                                        const void * r2)
+{
+       return LyXDirEntry::ldeCompProc((const LyXDirEntry *)r1,
+                                       (const LyXDirEntry *)r2);
+}
+
 // *** LyXFileDlg class implementation
 
 // static members
@@ -361,7 +374,7 @@ void LyXFileDlg::Reread()
 
        // Sort the names
        qsort(pCurrentNames, iNumNames, sizeof(LyXDirEntry), 
-             (int (*)(const void *, const void *))LyXDirEntry::ldeCompProc);
+             C_LyXDirEntry_ldeCompProc);
 
        // Add them to directory box
        for (i = 0; i < iNumNames; ++i) {
@@ -412,27 +425,28 @@ LyXFileDlg::LyXFileDlg()
                pFileDlgForm = create_form_FileDlg();
                // Set callbacks. This means that we don't need a patch file
                fl_set_object_callback(pFileDlgForm->DirBox,
-                                      LyXFileDlg::FileDlgCB,0);
+                                      C_LyXFileDlg_FileDlgCB,0);
                fl_set_object_callback(pFileDlgForm->PatBox,
-                                      LyXFileDlg::FileDlgCB,1);
+                                      C_LyXFileDlg_FileDlgCB,1);
                fl_set_object_callback(pFileDlgForm->List,
-                                      LyXFileDlg::FileDlgCB,2);
+                                      C_LyXFileDlg_FileDlgCB,2);
                fl_set_object_callback(pFileDlgForm->Filename,
-                                      LyXFileDlg::FileDlgCB,3);
+                                      C_LyXFileDlg_FileDlgCB,3);
                fl_set_object_callback(pFileDlgForm->Rescan,
-                                      LyXFileDlg::FileDlgCB,10);
+                                      C_LyXFileDlg_FileDlgCB,10);
                fl_set_object_callback(pFileDlgForm->Home,
-                                      LyXFileDlg::FileDlgCB,11);
+                                      C_LyXFileDlg_FileDlgCB,11);
                fl_set_object_callback(pFileDlgForm->User1,
-                                      LyXFileDlg::FileDlgCB,12);
+                                      C_LyXFileDlg_FileDlgCB,12);
                fl_set_object_callback(pFileDlgForm->User2,
-                                      LyXFileDlg::FileDlgCB,13);
+                                      C_LyXFileDlg_FileDlgCB,13);
                
                // Make sure pressing the close box doesn't crash LyX. (RvdK)
-               fl_set_form_atclose(pFileDlgForm->FileDlg, CancelCB, 0);
+               fl_set_form_atclose(pFileDlgForm->FileDlg, 
+                                   C_LyXFileDlg_CancelCB, 0);
                // Register doubleclick callback
                fl_set_browser_dblclick_callback(pFileDlgForm->List,
-                                                DoubleClickCB,0);
+                                                C_LyXFileDlg_DoubleClickCB,0);
        }
        fl_hide_object(pFileDlgForm->User1);
        fl_hide_object(pFileDlgForm->User2);
@@ -559,6 +573,11 @@ void LyXFileDlg::FileDlgCB(FL_OBJECT *, long lArgument)
        }
 }
 
+extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT *ob, long data) 
+{
+       LyXFileDlg::FileDlgCB(ob, data);
+}
+
 
 // Handle callback from list
 void LyXFileDlg::HandleListHit()
@@ -581,6 +600,10 @@ void LyXFileDlg::DoubleClickCB(FL_OBJECT *, long)
                pCurrentDlg->Force(false);
 }
 
+extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT *ob, long data)
+{
+       LyXFileDlg::DoubleClickCB(ob, data);
+}
 
 // Handle double click from list
 bool LyXFileDlg::HandleDoubleClick()
@@ -685,6 +708,10 @@ int LyXFileDlg::CancelCB(FL_FORM *, void *)
        return FL_IGNORE;
 }
 
+extern "C" int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev)
+{
+       return LyXFileDlg::CancelCB(fl, xev);
+}
 
 // Simulates a click on OK/Cancel
 void LyXFileDlg::Force(bool cancel)
index 9a82773932c62edadafda1374e78f838fd7bd6ec..a6dbfb154f13a85a1f96dda1a761a653f4ab5588 100644 (file)
@@ -84,9 +84,10 @@ private:
        string pszName;
        string pszDisplayed;
        string pszLsEntry;
+       LyXDirEntry() {};
+public:
        /// compares two LyXDirEntry objects content (used by qsort)
        static int ldeCompProc(const LyXDirEntry *r1, const LyXDirEntry *r2);
-       LyXDirEntry() {};
 };
 
 
@@ -112,6 +113,8 @@ public:
        static void FileDlgCB(FL_OBJECT *, long);
        /// Callback for double click in list
        static void DoubleClickCB(FL_OBJECT *, long);
+       /// Handle Cancel CB from WM close
+       static int CancelCB(FL_FORM *, void *);
 private:
        // data
        static FD_FileDlg *pFileDlgForm;
@@ -148,8 +151,6 @@ private:
        bool HandleDoubleClick();
        /// Handle OK button call
        bool HandleOK();
-       /// Handle Cancel CB from WM close
-       static int CancelCB(FL_FORM *, void *);
        /// Simulates a click on OK/Cancel
        void Force(bool);
 };
index a3a1bdf83d7aa1a769456fbeac9f20e1983d11f1..b96fc747a0d392e78b226b75fdbe589f2172a982 100644 (file)
@@ -31,6 +31,9 @@
 
 extern LyXRC* lyxrc;
 
+// a wrapper around the callback static member.
+extern "C" void C_Intl_DispatchCallback(FL_OBJECT *ob,long code);
+
 
 Intl::Intl()
        : prim_lang(lyxrc->primary_kbmap), 
@@ -225,6 +228,10 @@ void Intl::DispatchCallback(FL_OBJECT *ob,long code)
        if (itl!=0) itl->Keymap(code);
 }
 
+extern "C" void C_Intl_DispatchCallback(FL_OBJECT *ob,long code)
+{
+       Intl::DispatchCallback(ob,code);
+}
 
 void Intl::InitKeyMapper(bool on)
        /* initialize key mapper */
@@ -253,13 +260,19 @@ void Intl::InitKeyMapper(bool on)
                fd_form_keymap->KeyOnBtn2->u_vdata=(void *)this;
 
        // add the callbacks.
-       fl_set_object_callback(fd_form_keymap->AcceptChset,DispatchCallback,27);
-       fl_set_object_callback(fd_form_keymap->Charset,DispatchCallback,26);
-       fl_set_object_callback(fd_form_keymap->Accept,DispatchCallback,0);
-
-       fl_set_object_callback(fd_form_keymap->KeyOnBtn,DispatchCallback,23);
-       fl_set_object_callback(fd_form_keymap->KeyOffBtn,DispatchCallback,3);
-       fl_set_object_callback(fd_form_keymap->KeyOnBtn2,DispatchCallback,43);
+       fl_set_object_callback(fd_form_keymap->AcceptChset,
+                              C_Intl_DispatchCallback,27);
+       fl_set_object_callback(fd_form_keymap->Charset,
+                              C_Intl_DispatchCallback,26);
+       fl_set_object_callback(fd_form_keymap->Accept,
+                              C_Intl_DispatchCallback,0);
+
+       fl_set_object_callback(fd_form_keymap->KeyOnBtn,
+                              C_Intl_DispatchCallback,23);
+       fl_set_object_callback(fd_form_keymap->KeyOffBtn,
+                              C_Intl_DispatchCallback,3);
+       fl_set_object_callback(fd_form_keymap->KeyOnBtn2,
+                              C_Intl_DispatchCallback,43);
        
        // Make sure pressing the close box does not kill LyX. (RvdK)
        fl_set_form_atclose(fd_form_keymap->KeyMap, CancelCloseBoxCB, 0);
index beba4d595a60b70134141f120e634bde0e3cc3ce..97605c11e85c839afa0d79a17efff903865c42f6 100644 (file)
@@ -64,6 +64,8 @@ public:
        bool keymapon;
        ///
        char *chsetcode;
+       ///
+       static void DispatchCallback(FL_OBJECT*,long);
 private:
        ///
        //int SelectCharset(char const *code);
@@ -76,8 +78,6 @@ private:
        ///
        void Keymap(long code);
        ///
-       static void DispatchCallback(FL_OBJECT*,long);
-       ///
        bool primarykeymap;
        ///
        int curkeymap;
index 09076d1d4fa69938f2c81ebd36d05fbe881f5975..719412757e8930080993a5691f35a3dabbed1ee7 100644 (file)
@@ -79,6 +79,10 @@ int  mkfifo( char *__path, mode_t __mode ) {
 
 extern LyXAction lyxaction;
 
+// C wrapper
+extern "C" void C_LyXComm_callback(int fd, void *v);
+
+
 // LyXComm class
  
  // Open pipes
@@ -148,7 +152,7 @@ void LyXComm::openConnection() {
                       << strerror(errno) << endl;
                return;
        }
-       fl_add_io_callback(infd, FL_READ, callback, (void*)this);
+       fl_add_io_callback(infd, FL_READ, C_LyXComm_callback, (void*)this);
  
        // --- prepare output pipe ---------------------------------------
  
@@ -234,7 +238,7 @@ void LyXComm::closeConnection() {
        }
  
        if(infd > -1) {
-               fl_remove_io_callback(infd, FL_READ, callback);
+               fl_remove_io_callback(infd, FL_READ, C_LyXComm_callback);
  
                string tmp = pipename + ".in";
 #ifdef __EMX__         // Notify the operating system.
@@ -346,6 +350,12 @@ void LyXComm::callback(int fd, void *v)
        c->openConnection();
        errno=0;
 }
+
+extern "C" void C_LyXComm_callback(int fd, void *v)
+{
+       LyXComm::callback(fd, v);
+}
+
  
 void LyXComm::send(string const & msg) {
        if (msg.empty()) {
index 761222a6700f66e30c53b4a26f6cae9842780a7a..9dcdf99d65570e7c8a1861dbb2145992659e4362 100644 (file)
@@ -53,6 +53,10 @@ public:
 
        /// Send message
        void send(string const &);
+
+       /// We receive messages via XForms through this callback
+       static void callback(int fd, void *v);
+
 private:
        /// Open pipes
        void openConnection();
@@ -60,9 +64,6 @@ private:
        /// Close pipes
        void closeConnection();
 
-       /// We receive messages via XForms through this callback
-       static void callback(int fd, void *v);
-
        /// This is -1 if not open
        int infd;
 
index 28d036d14bcb90bde497e78af72f6fc9495efd61..ae51ae8138e490ef694a54531c7aeb74dbe4b321 100644 (file)
@@ -308,6 +308,12 @@ void LyXVC::logClose(FL_OBJECT *obj, long)
        fl_hide_form(This->browser->LaTeXLog);
 }
 
+// and, hack over hack, here is a C wrapper :)
+extern "C" void C_LyXVC_logClose(FL_OBJECT *ob, long data)
+{
+       LyXVC::logClose(ob, data);
+}
+
 
 void LyXVC::logUpdate(FL_OBJECT *obj, long)
 {
@@ -315,6 +321,11 @@ void LyXVC::logUpdate(FL_OBJECT *obj, long)
        This->showLog();
 }
 
+extern "C" void C_LyXVC_logUpdate(FL_OBJECT *ob, long data)
+{
+       LyXVC::logUpdate(ob, data);
+}
+
 
 void LyXVC::viewLog(string const & fil)
 {
@@ -328,12 +339,12 @@ void LyXVC::viewLog(string const & fil)
                browser->browser_latexlog = fl_add_browser(FL_NORMAL_BROWSER, 10, 10, 450, 320, "");
                obj = fl_add_button(FL_RETURN_BUTTON, 270, 340, 90, 30, _("Close"));
                fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-               fl_set_object_callback(obj, logClose, 0);
+               fl_set_object_callback(obj, C_LyXVC_logClose, 0);
                obj = fl_add_button(FL_NORMAL_BUTTON,370,340,90,30,
                                    idex(_("Update|#Uu")));
                fl_set_button_shortcut(obj,scex(_("Update|#Uu")),1);
                fl_set_object_lsize(obj,FL_NORMAL_SIZE);
-               fl_set_object_callback(obj,logUpdate,0);
+               fl_set_object_callback(obj, C_LyXVC_logUpdate,0);
                fl_end_form();
                fl_set_form_atclose(browser->LaTeXLog, CancelCloseBoxCB, 0);
        }
index cfb3529a61a2d89cd7df320f60dd3e9b6950ac7a..c28a428804ddaead73fd754bc95830c0b9abaa31 100644 (file)
@@ -87,6 +87,11 @@ public:
 
        /// Returns the userid of the person who has locked the doc.
        string const getLocker() const;
+
+       ///
+       static void logClose(FL_OBJECT*, long);
+       ///
+       static void logUpdate(FL_OBJECT*, long);
 protected:
 private:
        ///
@@ -133,10 +138,6 @@ private:
        ///
        FD_LaTeXLog *browser; // FD_LaTeXLog is just a browser with a
        // close button. Unfortunately we can not use the standard callbacks.
-       ///
-       static void logClose(FL_OBJECT*, long);
-       ///
-       static void logUpdate(FL_OBJECT*, long);
 };
 
 #endif
index 3cbf155a69c3c081a55bab91770a69518fd8a744..3e5c4c5101a0b72fd9d9d9cee1e494316fe65ef2 100644 (file)
@@ -64,6 +64,54 @@ extern void ToggleFloat();
 extern void AllFloats(char flag, char figmar);
 extern void LaTeXOptions();
 
+// A bunch of wrappers
+
+extern "C" void C_Menus_ShowFileMenu(FL_OBJECT *ob, long data)
+{
+       Menus::ShowFileMenu(ob, data);
+}
+
+extern "C" void C_Menus_ShowFileMenu2(FL_OBJECT *ob, long data)
+{
+       Menus::ShowFileMenu2(ob, data);
+}
+
+extern "C" void C_Menus_ShowEditMenu(FL_OBJECT *ob, long data)
+{
+       Menus::ShowEditMenu(ob, data);
+}
+
+extern "C" void C_Menus_ShowLayoutMenu(FL_OBJECT *ob, long data)
+{
+       Menus::ShowLayoutMenu(ob, data);
+}
+
+extern "C" void C_Menus_ShowInsertMenu(FL_OBJECT *ob, long data)
+{
+       Menus::ShowInsertMenu(ob, data);
+}
+
+extern "C" void C_Menus_ShowMathMenu(FL_OBJECT *ob, long data)
+{
+       Menus::ShowMathMenu(ob, data);
+}
+
+extern "C" void C_Menus_ShowOptionsMenu(FL_OBJECT *ob, long data)
+{
+       Menus::ShowOptionsMenu(ob, data);
+}
+
+extern "C" void C_Menus_ShowBufferMenu(FL_OBJECT *ob, long data)
+{
+       Menus::ShowBufferMenu(ob, data);
+}
+
+extern "C" void C_Menus_ShowHelpMenu(FL_OBJECT *ob, long data)
+{
+       Menus::ShowHelpMenu(ob, data);
+}
+
+
 Menus::Menus(LyXView *view,int air)
        : _view(view)
 {      
@@ -167,7 +215,7 @@ void Menus::create_menus(int air)
                              mbheight,_("File"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#F")), 1);
-       fl_set_object_callback(obj,ShowFileMenu, 0);
+       fl_set_object_callback(obj,C_Menus_ShowFileMenu, 0);
        obj->u_ldata = (long)this;
        
        // Edit menu button
@@ -181,7 +229,7 @@ void Menus::create_menus(int air)
                              mbheight,_("Edit"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#E")),1);
-       fl_set_object_callback(obj,ShowEditMenu,0);
+       fl_set_object_callback(obj,C_Menus_ShowEditMenu,0);
        obj->u_ldata = (long) this;
        
        // Layout menu button
@@ -195,7 +243,7 @@ void Menus::create_menus(int air)
                                          mbheight,_("Layout"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#L")), 1);
-       fl_set_object_callback(obj,ShowLayoutMenu,0);
+       fl_set_object_callback(obj,C_Menus_ShowLayoutMenu,0);
        obj->u_ldata = (long) this;
        
        // Insert menu button button
@@ -209,7 +257,7 @@ void Menus::create_menus(int air)
                              mbheight,_("Insert"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#I")), 1);
-       fl_set_object_callback(obj,ShowInsertMenu,0);
+       fl_set_object_callback(obj,C_Menus_ShowInsertMenu,0);
        obj->u_ldata = (long) this;
        
        // Math menu button
@@ -223,7 +271,7 @@ void Menus::create_menus(int air)
                              mbheight,_("Math"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#M")), 1);
-       fl_set_object_callback(obj,ShowMathMenu,0);
+       fl_set_object_callback(obj,C_Menus_ShowMathMenu,0);
        obj->u_ldata = (long) this;
        
        // Options menu button
@@ -237,7 +285,7 @@ void Menus::create_menus(int air)
                              mbheight,_("Options"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#O")), 1);
-       fl_set_object_callback(obj,ShowOptionsMenu, 0);
+       fl_set_object_callback(obj,C_Menus_ShowOptionsMenu, 0);
        obj->u_ldata = (long) this;
 
        // Documents menu button
@@ -251,7 +299,7 @@ void Menus::create_menus(int air)
                              mbheight,_("Documents"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#D")), 1);
-       fl_set_object_callback(obj,ShowBufferMenu,0);
+       fl_set_object_callback(obj,C_Menus_ShowBufferMenu,0);
        obj->u_ldata = (long) this;
        
        // Help menu button
@@ -265,7 +313,7 @@ void Menus::create_menus(int air)
                              mbheight,_("Help"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#H")), 1);
-       fl_set_object_callback(obj,ShowHelpMenu,0);
+       fl_set_object_callback(obj,C_Menus_ShowHelpMenu,0);
        obj->u_ldata = (long) this;
        
        fl_end_group();
@@ -298,7 +346,7 @@ void Menus::create_menus(int air)
                              mbheight,_("File"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#F")), 1);
-       fl_set_object_callback(obj,ShowFileMenu2, 0);
+       fl_set_object_callback(obj,C_Menus_ShowFileMenu2, 0);
        obj->u_ldata = (long)this;
        
        // Options menu button
@@ -312,7 +360,7 @@ void Menus::create_menus(int air)
                              mbheight,_("Options"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#O")), 1);
-       fl_set_object_callback(obj,ShowOptionsMenu, 0);
+       fl_set_object_callback(obj,C_Menus_ShowOptionsMenu, 0);
        obj->u_ldata = (long) this;
 
        // Help menu button
@@ -326,7 +374,7 @@ void Menus::create_menus(int air)
                              mbheight,_("Help"));
        moffset += obj->w + air;
        fl_set_object_shortcut(obj, scex(_("MB|#H")), 1);
-       fl_set_object_callback(obj,ShowHelpMenu,0);
+       fl_set_object_callback(obj,C_Menus_ShowHelpMenu,0);
        obj->u_ldata = (long) this;
        
        fl_end_group();
index faff62f081a6c044a6ac88980cdf7c1e8f2b162d..bda481d11fb4281a1e264a1767da4c52d7cfed80 100644 (file)
@@ -35,20 +35,6 @@ public:
        void hideMenus();
        ///
        void openByName(string const &menuName);
-private:
-       ///
-       void create_menus(int air);
-       ///
-       void ScreenOptions();
-       ///
-       void showCopyright();
-       ///
-       void showLicense();
-       ///
-       void MenuDocu(string const & docname);
-       ///
-       void handleBufferMenu(int choice);
-       
        ///
        static void ShowFileMenu(FL_OBJECT *ob, long);
        ///
@@ -67,6 +53,20 @@ private:
        static void ShowBufferMenu(FL_OBJECT *ob, long);
        ///
        static void ShowHelpMenu(FL_OBJECT *ob, long);
+private:
+       ///
+       void create_menus(int air);
+       ///
+       void ScreenOptions();
+       ///
+       void showCopyright();
+       ///
+       void showLicense();
+       ///
+       void MenuDocu(string const & docname);
+       ///
+       void handleBufferMenu(int choice);
+       
        /// 
        BufferView *currentView();
        ///
index b253786c747707fabc0892ad31b78a63ebfb3b0b..e74ed3eac5aa06a3288c64d2386a8f08ea008343 100644 (file)
@@ -36,6 +36,10 @@ void MiniBuffer::TimerCB(FL_OBJECT *, long tmp)
        obj->Init();
 }
 
+extern "C" void C_MiniBuffer_TimerCB(FL_OBJECT *ob, long data)
+{
+       MiniBuffer::TimerCB(ob, data);
+}
 
 void MiniBuffer::ExecutingCB(FL_OBJECT *ob, long)
 {
@@ -72,6 +76,67 @@ void MiniBuffer::ExecutingCB(FL_OBJECT *ob, long)
        return ;
 }
 
+extern "C" void C_MiniBuffer_ExecutingCB(FL_OBJECT *ob, long data)
+{
+       MiniBuffer::TimerCB(ob, data);
+}
+
+// This is not as dirty as it seems, the hidden buttons removed by this
+// function were just kludges for an uncomplete keyboard callback (ale)
+int MiniBuffer::peek_event(FL_OBJECT *ob, int event, FL_Coord, FL_Coord,
+                          int key, void */*xev*/)
+{
+       MiniBuffer *mini = (MiniBuffer*)ob->u_vdata;
+       
+       if (event==FL_KEYBOARD){
+               switch (key) {
+               case XK_Down:
+                       mini->history_idx++;
+                       if (!mini->getHistory().empty()) {
+                               fl_set_input(ob, mini->getHistory().c_str());
+                       } else
+                               mini->history_idx--;
+                       return 1; 
+               case XK_Up:
+                       if (mini->history_idx > 0) mini->history_idx--;
+                       fl_set_input(ob, mini->getHistory().c_str());
+                       return 1; 
+               case 9:
+               case XK_Tab:
+               {
+                       // complete or increment the command
+                       const char *s = lyxaction.getApproxFuncName(fl_get_input(ob));
+                       if (s && s[0])
+                               fl_set_input(ob, s);
+                       return 1; 
+               }
+               case 27:
+               case XK_Escape:
+                       // Abort
+                       fl_set_focus_object(mini->owner->getForm(),
+                                           mini->owner->currentView()->getWorkArea());
+                       mini->Init();
+                       return 1; 
+               case 13:
+               case XK_Return:
+                       // Execute a command. 
+                       mini->cur_cmd = string(fl_get_input(ob));
+                       ExecutingCB(ob, 0);
+                       return 1;
+               default:
+                       return 0;
+               }
+       }
+       return 0;
+}
+
+extern "C" int C_MiniBuffer_peek_event(FL_OBJECT *ob, int event, 
+                                      FL_Coord, FL_Coord,
+                                      int key, void *xev)
+{
+       return MiniBuffer::peek_event(ob,event,0,0,key,xev);
+}
+
 
 void MiniBuffer::ExecCommand()
 {
@@ -92,16 +157,16 @@ FL_OBJECT *MiniBuffer::add(int type, FL_Coord x, FL_Coord y,
         fl_set_object_gravity(obj, SouthWestGravity, SouthEastGravity);
         fl_set_object_color(obj,FL_MCOL,FL_MCOL);
         fl_set_object_lsize(obj,FL_NORMAL_SIZE);
-       fl_set_object_callback(obj,ExecutingCB, 0);
+       fl_set_object_callback(obj,C_MiniBuffer_ExecutingCB, 0);
 
        // To intercept Up, Down, Table for history
-        fl_set_object_prehandler(obj, peek_event);
+        fl_set_object_prehandler(obj, C_MiniBuffer_peek_event);
         obj->u_vdata = (void*)this;
         obj->wantkey = FL_KEY_TAB;
        
        // timer
        timer = fl_add_timer(FL_HIDDEN_TIMER, 0,0,0,0, "Timer");
-       fl_set_object_callback(timer, TimerCB, (long)this);
+       fl_set_object_callback(timer, C_MiniBuffer_TimerCB, (long)this);
        fl_set_input(the_buffer, text.c_str());
 
        return obj;
@@ -203,52 +268,3 @@ void MiniBuffer::Deactivate()
 }
 
 
-// This is not as dirty as it seems, the hidden buttons removed by this
-// function were just kludges for an uncomplete keyboard callback (ale)
-int MiniBuffer::peek_event(FL_OBJECT *ob, int event, FL_Coord, FL_Coord,
-                          int key, void */*xev*/)
-{
-       MiniBuffer *mini = (MiniBuffer*)ob->u_vdata;
-       
-       if (event==FL_KEYBOARD){
-               switch (key) {
-               case XK_Down:
-                       mini->history_idx++;
-                       if (!mini->getHistory().empty()) {
-                               fl_set_input(ob, mini->getHistory().c_str());
-                       } else
-                               mini->history_idx--;
-                       return 1; 
-               case XK_Up:
-                       if (mini->history_idx > 0) mini->history_idx--;
-                       fl_set_input(ob, mini->getHistory().c_str());
-                       return 1; 
-               case 9:
-               case XK_Tab:
-               {
-                       // complete or increment the command
-                       const char *s = lyxaction.getApproxFuncName(fl_get_input(ob));
-                       if (s && s[0])
-                               fl_set_input(ob, s);
-                       return 1; 
-               }
-               case 27:
-               case XK_Escape:
-                       // Abort
-                       fl_set_focus_object(mini->owner->getForm(),
-                                           mini->owner->currentView()->getWorkArea());
-                       mini->Init();
-                       return 1; 
-               case 13:
-               case XK_Return:
-                       // Execute a command. 
-                       mini->cur_cmd = string(fl_get_input(ob));
-                       ExecutingCB(ob, 0);
-                       return 1;
-               default:
-                       return 0;
-               }
-       }
-       return 0;
-}
-
index 27b802c5b0b45a5fbe283cc386b68f9fe0d155b0..7c214d6f28f8b4cee5c35c68790d3d2e2ecead63 100644 (file)
@@ -51,6 +51,13 @@ public:
        void Activate();
        ///
        void Deactivate();
+       ///
+       static void ExecutingCB(FL_OBJECT *ob, long);
+       ///
+       static void TimerCB(FL_OBJECT *ob, long);
+       ///
+        static int  peek_event(FL_OBJECT *, int, FL_Coord, FL_Coord,
+                              int, void *);
 private:
        ///
        LyXView *owner;
@@ -60,13 +67,6 @@ private:
        string text_stored;
        ///
        FL_OBJECT *add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord);
-       ///
-       static void ExecutingCB(FL_OBJECT *ob, long);
-       ///
-       static void TimerCB(FL_OBJECT *ob, long);
-       ///
-        static int  peek_event(FL_OBJECT *, int, FL_Coord, FL_Coord,
-                              int, void *);
         ///
        FL_OBJECT *timer;
        ///
index fae4601c14febd5492daf7f4c364d449c993edac..28ff89134d30e26ab174e1b5f5d119769d4f8344 100644 (file)
@@ -136,13 +136,18 @@ Toolbar::Toolbar(Toolbar const &rct, LyXView *o, int x, int y)
 
 
 // timer-cb for bubble-help (Matthias)
-void Toolbar::BubbleTimerCB(FL_OBJECT *, long data){
+void Toolbar::BubbleTimerCB(FL_OBJECT *, long data)
+{
        FL_OBJECT* ob = (FL_OBJECT*) data;
        char* help = (char*) ob->u_vdata;
        fl_show_oneliner(help, ob->form->x + ob->x,
                         ob->form->y + ob->y + ob->h);
 }
 
+extern "C" void C_Toolbar_BubbleTimerCB(FL_OBJECT *ob, long data)
+{
+       Toolbar::BubbleTimerCB(ob, data);
+}
 
 // post_handler for bubble-help (Matthias)
 int Toolbar::BubblePost(FL_OBJECT *ob, int event,
@@ -153,7 +158,7 @@ int Toolbar::BubblePost(FL_OBJECT *ob, int event,
        
        if(event == FL_ENTER && !help.empty()){
                fl_set_object_callback(t->bubble_timer,
-                                      BubbleTimerCB, (long) ob);
+                                      C_Toolbar_BubbleTimerCB, (long) ob);
                fl_set_timer(t->bubble_timer, 1);
        }
        else if(event != FL_MOTION){
@@ -163,6 +168,12 @@ int Toolbar::BubblePost(FL_OBJECT *ob, int event,
        return 0;
 }
 
+extern "C" int C_Toolbar_BubblePost(FL_OBJECT *ob, int event,
+                                  FL_Coord /*mx*/, FL_Coord /*my*/, 
+                                  int key, void *xev)
+{
+       return Toolbar::BubblePost(ob,event,0,0,key,xev);
+}
 
 void Toolbar::activate()
 {
@@ -201,6 +212,10 @@ void Toolbar::ToolbarCB(FL_OBJECT *ob, long ac)
                lyxerr[Debug::TOOLBAR] << res << endl;
 }
 
+extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT *ob, long data)
+{
+       Toolbar::ToolbarCB(ob, data);
+}
 
 int Toolbar::get_toolbar_func(string const & func)
 {
@@ -305,7 +320,7 @@ void Toolbar::set(bool doingmain)
                          fl_set_object_gravity(obj,
                                                NorthWestGravity,
                                                NorthWestGravity);
-                         fl_set_object_callback(obj,ToolbarCB,
+                         fl_set_object_callback(obj,C_Toolbar_ToolbarCB,
                                                 (long)item->action);
 #if FL_REVISION >85
                          // Remove the blue feedback rectangle
@@ -318,7 +333,7 @@ void Toolbar::set(bool doingmain)
                          // belongs too. (Lgb)
                          obj->u_ldata = (long) this;
                          
-                         fl_set_object_posthandler(obj, BubblePost);
+                         fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
 
                          fl_set_pixmapbutton_data(obj,item->pixmap);
                          item = item->next;
index 67b4a549bbed7fae53ba77cc9253192e77f93fbe..f29f2fd024a7ac3fdbaa6c33f0fc0e79fbd51870 100644 (file)
@@ -86,6 +86,14 @@ public:
        /// deactivates the toolbar
         void deactivate();
 
+       ///
+       static void ToolbarCB(FL_OBJECT*, long);
+       ///
+       static void BubbleTimerCB(FL_OBJECT *, long);
+       ///
+       static int BubblePost(FL_OBJECT *ob, int event,
+                             FL_Coord mx, FL_Coord my, int key, void *xev);
+
 private:
        ///
        struct toolbarItem
@@ -147,13 +155,6 @@ private:
        char **getPixmap(kb_action, string const & arg=string());
        /// removes all toolbar buttons from the toolbar.
        void clean();
-       ///
-       static void ToolbarCB(FL_OBJECT*, long);
-       ///
-       static void BubbleTimerCB(FL_OBJECT *, long);
-       ///
-       static int BubblePost(FL_OBJECT *ob, int event,
-                             FL_Coord mx, FL_Coord my, int key, void *xev);
 
        /** more...
         */