AC_SUBST(LT_VERSION_INFO)
### REQUIREMENTS ##############################################################
-GTK_REQUIRED_VERSION=2.12
-GLIB_REQUIRED_VERSION=2.16
+GTK_REQUIRED_VERSION=2.6
+GLIB_REQUIRED_VERSION=2.6
GTK_DOC_REQUIRED_VERSION=1.9
AC_SUBST(GTK_REQUIRED_VERSION)
AC_SUBST(GLIB_REQUIRED_VERSION)
/* Empty cache */
if(link == NULL) {
gdk_threads_leave();
- printf("Cache miss for image %d\n", to_find->resource_number);
return NULL;
}
if(info->width == to_find->width && info->height == to_find->height) {
/* Prescaled image found */
gdk_threads_leave();
- printf("Exact cache hit for image %d\n", to_find->resource_number);
return info;
}
else if(info->width >= to_find->width && info->height >= to_find->height) {
} else {
if(!info->scaled) {
gdk_threads_leave();
- printf("Exact cache hit for image %d\n", to_find->resource_number);
return info; /* Found a match */
}
}
gdk_threads_leave();
- if(match == NULL)
- printf("Cache miss for image %d\n", to_find->resource_number);
- else
- printf("Approx cache hit for image %d\n", to_find->resource_number);
-
return match;
}
VALID_WINDOW(win, return);
g_return_if_fail(win->type == wintype_Graphics);
-
gdk_threads_enter();
GdkPixmap *map;
gtk_image_get_pixmap( GTK_IMAGE(win->widget), &map, NULL );
GdkGC *gc = gdk_gc_new(map);
- gdk_gc_set_foreground( gc, glkcolor_to_gdkcolor(color) );
+ GdkColor gdkcolor;
+ glkcolor_to_gdkcolor(color, &gdkcolor);
+ gdk_gc_set_rgb_fg_color(gc, &gdkcolor);
gdk_draw_rectangle( GDK_DRAWABLE(map), gc, TRUE, left, top, width, height);
gtk_widget_queue_draw(win->widget);
g_object_unref(gc);
}
/* Internal function: parses a glk color to a GdkColor */
-GdkColor*
-glkcolor_to_gdkcolor(glui32 val)
+void
+glkcolor_to_gdkcolor(glui32 val, GdkColor *color)
{
- GdkColor* color = g_new0(GdkColor, 1);
- color->red = (val & 0xff0000) >> 16;
- color->green = (val & 0x00ff00) >> 8;
- color->blue = val & 0x0000ff;
-
- return color;
+ color->red = 256 * ((val & 0xff0000) >> 16);
+ color->green = 256 * ((val & 0x00ff00) >> 8);
+ color->blue = 256 * (val & 0x0000ff);
}
/* Internal function: parses a GdkColor to a glk color */
G_GNUC_INTERNAL PangoFontDescription* get_current_font(guint32 wintype);
G_GNUC_INTERNAL GtkTextTag* gtk_text_tag_copy(GtkTextTag *tag);
-G_GNUC_INTERNAL GdkColor* glkcolor_to_gdkcolor(glui32 val);
+G_GNUC_INTERNAL void glkcolor_to_gdkcolor(glui32 val, GdkColor *color);
typedef struct StyleSet {
GHashTable *text_grid;
win->unit_height = 1;
win->widget = image;
win->frame = image;
+ win->background_color = 0x00FFFFFF;
/* Connect signal handlers */
win->button_press_event_handler = g_signal_connect(image, "button-press-event", G_CALLBACK(on_window_button_press), win);
* input
* user1
* user2
+ * hyperlink
*
* Possible style hints:
* font-family (string)
buffer.user2 {
}
+
+buffer.hyperlink {
+ color: #ff0000;
+}
void
do_mouse_test() {
- glk_request_mouse_event(mainwin);
+ glk_set_window(statuswin);
+ glk_window_move_cursor(statuswin, 0, 0);
+ glk_put_string("Click me......\n");
glk_request_mouse_event(statuswin);
+ glk_set_window(mainwin);
}
void