]> git.lyx.org Git - lyx.git/blobdiff - src/bmtable.c
small changes to ButtonController usage
[lyx.git] / src / bmtable.c
index 9d97965ddb5b445870e930f58ac84bdcb17a0aeb..e8fca4b31e079ca2fde3fe3f5ce10815b432f14f 100644 (file)
 
 #include <config.h>
 
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
 #include <stdlib.h>
 #include "bmtable.h"
 #include XPM_H_LOCATION
@@ -68,7 +72,8 @@ FL_OBJECT *fl_add_bmtable(int type, FL_Coord x, FL_Coord y,
 }
 
 
-static void draw_bitmaptable(FL_OBJECT *ob)
+static
+void draw_bitmaptable(FL_OBJECT *ob)
 {
        int i, j, lx;
        FL_Coord mx, my;
@@ -253,15 +258,9 @@ void fl_set_bmtable_pixmap_data(FL_OBJECT * ob, int nx, int ny,
                        char ** pdata)
 {
        BMTABLE_SPEC * sp = (BMTABLE_SPEC *)ob->spec;
-       extern Colormap color_map;
        if (sp) {
                Pixmap dummy_shapemask = 0;
-#if 0
-               // I can't see why this initalization is needed. (Lgb)
-               XpmAttributes dumb_attributes = {0};
-#else
-               XpmAttributes dumb_attributes;
-#endif
+               XpmAttributes dumb_attributes = { 0 };
                sp->nx = nx;
                sp->ny = ny; 
                sp->bx = FL_abs(ob->bw);
@@ -271,7 +270,7 @@ void fl_set_bmtable_pixmap_data(FL_OBJECT * ob, int nx, int ny,
                sp->i = -1;
                sp->maxi = sp->nx * sp->ny;
                sp->bdata = 0;
-               dumb_attributes.colormap = color_map;
+               dumb_attributes.colormap = fl_state[fl_get_vclass()].colormap;
                dumb_attributes.closeness = 30000;
                dumb_attributes.valuemask = XpmColormap | XpmCloseness;
                if (XCreatePixmapFromData(fl_display, fl_winget(), pdata,
@@ -284,7 +283,6 @@ void fl_set_bmtable_pixmap_data(FL_OBJECT * ob, int nx, int ny,
                                XFreePixmap(fl_display, dummy_shapemask);
                        }
                }
-               XFlush(fl_display);
        }
 }
 
@@ -320,15 +318,11 @@ void fl_set_bmtable_file(FL_OBJECT * ob, int nx, int ny, char const * filename)
 
 void fl_set_bmtable_pixmap_file(FL_OBJECT *ob, int nx, int ny, char const *filename)
 {      
-       extern Colormap color_map;
+  /* extern Colormap color_map; */
        BMTABLE_SPEC *sp = (BMTABLE_SPEC *)ob->spec;
        if (sp) {
                Pixmap dummy_shapemask = 0;
-#if 0
-               XpmAttributes dumb_attributes = {0};
-#else
-               XpmAttributes dumb_attributes;
-#endif
+               XpmAttributes dumb_attributes = { 0 };
                sp->nx = nx;
                sp->ny = ny; 
                sp->bx = FL_abs(ob->bw);
@@ -339,7 +333,7 @@ void fl_set_bmtable_pixmap_file(FL_OBJECT *ob, int nx, int ny, char const *filen
                sp->maxi = sp->nx * sp->ny;
                sp->bdata = 0;
 
-               dumb_attributes.colormap = color_map;
+               dumb_attributes.colormap = fl_state[fl_get_vclass()].colormap;
                dumb_attributes.closeness = 30000;
                dumb_attributes.valuemask = XpmColormap | XpmCloseness;
    
@@ -353,7 +347,7 @@ void fl_set_bmtable_pixmap_file(FL_OBJECT *ob, int nx, int ny, char const *filen
                                XFreePixmap(fl_display, dummy_shapemask);
                        }
                }
-               XFlush(fl_display);
+               /* XFlush(fl_display); */
        }
 }