|
|
| version 1.5, 2005/04/01 15:11:45 | version 1.6, 2007/01/10 15:58:21 |
|---|---|
| Line 79 fontmng_create(int size, UINT type, cons | Line 79 fontmng_create(int size, UINT type, cons |
| gchar *fontname_utf8; | gchar *fontname_utf8; |
| int fontalign; | int fontalign; |
| int allocsize; | int allocsize; |
| GdkColormap *colormap; | GdkColormap *cmap; |
| GdkColor color; | GdkColor color; |
| gboolean rv; | |
| if (size < 0) { | if (size < 0) { |
| size = -size; | size = -size; |
| Line 106 fontmng_create(int size, UINT type, cons | Line 107 fontmng_create(int size, UINT type, cons |
| return NULL; | return NULL; |
| } | } |
| colormap = gtk_widget_get_colormap(GTK_WIDGET(main_window)); | cmap = gtk_widget_get_colormap(GTK_WIDGET(main_window)); |
| color.red = color.green = color.blue = 0; | memset(&color, 0, sizeof(color)); |
| if (gdk_color_alloc(colormap, &color) == 0) { | rv = gdk_colormap_alloc_color(cmap, &color, FALSE, FALSE); |
| fnt.black_pixel = 0; | if (rv) { |
| } else { | |
| fnt.black_pixel = color.pixel; | fnt.black_pixel = color.pixel; |
| } else { | |
| fnt.black_pixel = 0; | |
| } | } |
| fnt.layout = gtk_widget_create_pango_layout(main_window, NULL); | fnt.layout = gtk_widget_create_pango_layout(main_window, NULL); |
| Line 150 fontmng_destroy(void *hdl) | Line 152 fontmng_destroy(void *hdl) |
| if (fnt) { | if (fnt) { |
| if (fnt->backsurf) | if (fnt->backsurf) |
| gdk_pixmap_unref(fnt->backsurf); | g_object_unref(fnt->backsurf); |
| if (fnt->layout) | if (fnt->layout) |
| g_object_unref(fnt->layout); | g_object_unref(fnt->layout); |
| if (fnt->desc) | if (fnt->desc) |
| Line 160 fontmng_destroy(void *hdl) | Line 162 fontmng_destroy(void *hdl) |
| } | } |
| static void | static void |
| setfdathead(FNTMNG fhdl, FNTDAT fdat, const gchar *str, int len) | setfdathead(FNTMNG fhdl, FNTDAT fdat, const char *str, int len) |
| { | { |
| UNUSED(str); | UNUSED(str); |
| Line 174 setfdathead(FNTMNG fhdl, FNTDAT fdat, co | Line 176 setfdathead(FNTMNG fhdl, FNTDAT fdat, co |
| } | } |
| static void | static void |
| getlength1(FNTMNG fhdl, FNTDAT fdat, const gchar *str, int len) | getlength1(FNTMNG fhdl, FNTDAT fdat, const char *str, int len) |
| { | { |
| setfdathead(fhdl, fdat, str, len); | setfdathead(fhdl, fdat, str, len); |
| } | } |
| static void | static void |
| getfont1(FNTMNG fhdl, FNTDAT fdat, const gchar *str, int len) | getfont1(FNTMNG fhdl, FNTDAT fdat, const char *str, int len) |
| { | { |
| GdkImage *img; | GdkImage *img; |
| Line 210 getfont1(FNTMNG fhdl, FNTDAT fdat, const | Line 212 getfont1(FNTMNG fhdl, FNTDAT fdat, const |
| p++; | p++; |
| } | } |
| } | } |
| gdk_image_destroy(img); | g_object_unref(img); |
| } else { | } else { |
| memset(fdat + 1, 0, fdat->width * fdat->height); | memset(fdat + 1, 0, fdat->width * fdat->height); |
| } | } |
| Line 221 fontmng_getsize(void *hdl, const char *s | Line 223 fontmng_getsize(void *hdl, const char *s |
| { | { |
| FNTMNG fhdl = (FNTMNG)hdl; | FNTMNG fhdl = (FNTMNG)hdl; |
| _FNTDAT fdat; | _FNTDAT fdat; |
| UINT8 buf[4]; | char buf[4]; |
| int width; | int width; |
| int len; | int len; |
| Line 250 fontmng_getdrawsize(void *hdl, const cha | Line 252 fontmng_getdrawsize(void *hdl, const cha |
| { | { |
| FNTMNG fhdl = (FNTMNG)hdl; | FNTMNG fhdl = (FNTMNG)hdl; |
| _FNTDAT fdat; | _FNTDAT fdat; |
| UINT8 buf[4]; | char buf[4]; |
| int width; | int width; |
| int len; | int len; |
| int posx; | int posx; |
| Line 282 fontmng_get(void *hdl, const char *str) | Line 284 fontmng_get(void *hdl, const char *str) |
| { | { |
| FNTMNG fhdl = (FNTMNG)hdl; | FNTMNG fhdl = (FNTMNG)hdl; |
| FNTDAT fdat = (FNTDAT)(fhdl + 1); | FNTDAT fdat = (FNTDAT)(fhdl + 1); |
| UINT8 buf[4]; | char buf[4]; |
| gchar *utf8; | gchar *utf8; |
| int len; | int len; |