]> git.lyx.org Git - lyx.git/blobdiff - src/toolbar.C
use the new bufferstorage (this change only deletes all references to the old one
[lyx.git] / src / toolbar.C
index fae4601c14febd5492daf7f4c364d449c993edac..7a5a68a7370ac6462e386356a15adceb5918ed2b 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of
- * ======================================================
+ * ====================================================== 
  * 
  *           LyX, The Document Processor
  *
@@ -9,7 +9,7 @@
  *           This file is Copyright 1996-1998
  *           Lars Gullik Bjønnes
  *
- * ======================================================*/
+ * ====================================================== */
 
 //  Added pseudo-action handling, asierra 180296
 
@@ -130,19 +130,24 @@ Toolbar::Toolbar(Toolbar const &rct, LyXView *o, int x, int y)
                add(tmplist->action);
                lyxerr[Debug::TOOLBAR] << "tool action: "
                                       << tmplist->action << endl;
-               tmplist=tmplist->next;
+               tmplist= tmplist->next;
        }
 }
 
 
 // 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,10 +168,16 @@ 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()
 {
-       toolbarItem *item, *tmp=0;
+       toolbarItem *item, *tmp= 0;
        item = toollist;
        while(item){
                tmp = item->next;
@@ -180,7 +191,7 @@ void Toolbar::activate()
 
 void Toolbar::deactivate()
 {
-       toolbarItem *item, *tmp=0;
+       toolbarItem *item, *tmp= 0;
        item = toollist;
        while(item){
                tmp = item->next;
@@ -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)
 {
@@ -273,7 +288,7 @@ void Toolbar::set(bool doingmain)
        // add the time if it don't exist
        if (bubble_timer == 0)
                bubble_timer = fl_add_timer(FL_HIDDEN_TIMER,
-                                           xpos,ypos,0,0,"Timer");
+                                           xpos, ypos, 0, 0, "Timer");
        
        while(item != 0) {
                switch(item->action){
@@ -294,22 +309,22 @@ void Toolbar::set(bool doingmain)
                          break;
                  default:
                          xpos += standardspacing;
-                         item->icon = obj =
+                         item->icon = obj = 
                                  fl_add_pixmapbutton(FL_NORMAL_BUTTON,
-                                                     xpos,ypos,
+                                                     xpos, ypos,
                                                      buttonwidth,
-                                                     height,"");
-                         fl_set_object_boxtype(obj,FL_UP_BOX);
-                         fl_set_object_color(obj,FL_MCOL,FL_BLUE);
+                                                     height, "");
+                         fl_set_object_boxtype(obj, FL_UP_BOX);
+                         fl_set_object_color(obj, FL_MCOL, FL_BLUE);
                          fl_set_object_resize(obj, FL_RESIZE_ALL);
                          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
-                         fl_set_pixmapbutton_focus_outline(obj,0);
+                         fl_set_pixmapbutton_focus_outline(obj, 0);
 #endif
 
                          // set the bubble-help (Matthias)
@@ -318,9 +333,9 @@ 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);
+                         fl_set_pixmapbutton_data(obj, item->pixmap);
                          item = item->next;
                          // we must remember to update the positions
                          xpos += buttonwidth;
@@ -426,7 +441,7 @@ void Toolbar::add(int action, bool doclean)
                // first «hide» the toolbar buttons. This is not a real hide
                // actually it deletes and frees the button altogether.
                lyxerr << "Toolbar::add: «hide» the toolbar buttons." << endl;
-               toolbarItem *item, *tmp=0;
+               toolbarItem *item, *tmp= 0;
                item = toollist;
 
                lightReset();
@@ -540,7 +555,7 @@ void Toolbar::push(int nth)
        
        if (nth == 0) return;
 
-       int count=0;
+       int count= 0;
        toolbarItem *tmp = toollist;
        while (tmp) {
                count++;