#endif
#include <algorithm>
+using std::max;
#include "lyx_main.h"
#include "buffer.h"
};
extern char** mathed_get_pixmap_from_icon(int d);
-static void math_cb(FL_OBJECT*, long);
+extern "C" void math_cb(FL_OBJECT*, long);
static char** pixmapFromBitmapData(char const *, int, int);
void math_insert_symbol(char const* s);
Bool math_insert_greek(char const c);
}
FL_OBJECT*
-BitmapMenu::AddBitmap(int id, int nx, int ny, int bw, int bh, char* data, Bool vert)
+BitmapMenu::AddBitmap(int id, int nx, int ny, int bw, int bh, unsigned char* data, Bool vert)
{
if (i>=nb)
return 0;
bitmap[i]->u_vdata = this;
}
fl_end_form();
- fl_register_raw_callback(form, KeyPressMask, peek_event);
+ fl_register_raw_callback(form, KeyPressMask, C_peek_event);
}
int BitmapMenu::GetIndex(FL_OBJECT* ob)
return -1;
}
-extern "C" {
int peek_event(FL_FORM * /*form*/, void *xev)
{
if (BitmapMenu::active==0)
}
return 0;
}
+
+// This is just a wrapper.
+extern "C" int C_peek_event(FL_FORM *form, void *ptr) {
+ return peek_event(form,ptr);
}
-static void math_cb(FL_OBJECT* ob, long data)
+
+extern "C" void math_cb(FL_OBJECT* ob, long data)
{
BitmapMenu* menu = (BitmapMenu*)ob->u_vdata;
int i = menu->GetIndex(ob);
if (id>=0) break;
}
if (i<6 && id>=0) {
- char *bdata = 0;
+ unsigned char *bdata = 0;
int w = 0, h = 0, dw = 0, dh = 0;
lyxerr[Debug::MATHED] << "Imando " << i << ", " << id << endl;
int ww = w/dw, hh = h/dh, x, y;
XImage *xima = XCreateImage(fl_display, 0, 1, XYBitmap, 0,
- bdata, w, h, 8, 0);
+ reinterpret_cast<char*>(bdata), w, h, 8, 0);
xima->byte_order = LSBFirst;
xima->bitmap_bit_order = LSBFirst;
x = (id % dw)*ww;