| 52 { NULL, "arrow-left.xpm", 0, -13/2 }, |
54 { NULL, "arrow-left.xpm", 0, -13/2 }, |
| 53 { NULL, "arrow-right.xpm", -16, -13/2 }, |
55 { NULL, "arrow-right.xpm", -16, -13/2 }, |
| 54 { NULL, NULL, 0, 0 } |
56 { NULL, NULL, 0, 0 } |
| 55 }; |
57 }; |
| 56 |
58 |
| |
59 #if GTK_CHECK_VERSION(3,0,0) |
| |
60 |
| 57 static void |
61 static void |
| 58 dnd_hints_realized_cb(GtkWidget *window, GtkWidget *pix) |
62 dnd_hints_realized_cb(GtkWidget *window, GtkWidget *pix) |
| 59 { |
63 { |
| 60 GdkPixbuf *pixbuf; |
64 GdkPixbuf *pixbuf; |
| 61 cairo_surface_t *surface; |
65 cairo_surface_t *surface; |
| 100 g_signal_connect(G_OBJECT(win), "realize", |
104 g_signal_connect(G_OBJECT(win), "realize", |
| 101 G_CALLBACK(dnd_hints_realized_cb), pix); |
105 G_CALLBACK(dnd_hints_realized_cb), pix); |
| 102 |
106 |
| 103 return win; |
107 return win; |
| 104 } |
108 } |
| |
109 |
| |
110 #else |
| |
111 |
| |
112 static GtkWidget * |
| |
113 dnd_hints_init_window(const gchar *fname) |
| |
114 { |
| |
115 GdkPixbuf *pixbuf; |
| |
116 GdkPixmap *pixmap; |
| |
117 GdkBitmap *bitmap; |
| |
118 GtkWidget *pix; |
| |
119 GtkWidget *win; |
| |
120 GdkColormap *colormap; |
| |
121 |
| |
122 pixbuf = gdk_pixbuf_new_from_file(fname, NULL); |
| |
123 g_return_val_if_fail(pixbuf, NULL); |
| |
124 |
| |
125 win = gtk_window_new(GTK_WINDOW_POPUP); |
| |
126 colormap = gtk_widget_get_colormap(win); |
| |
127 gdk_pixbuf_render_pixmap_and_mask_for_colormap(pixbuf, colormap, |
| |
128 &pixmap, &bitmap, 128); |
| |
129 g_object_unref(G_OBJECT(pixbuf)); |
| |
130 |
| |
131 pix = gtk_image_new_from_pixmap(pixmap, bitmap); |
| |
132 gtk_container_add(GTK_CONTAINER(win), pix); |
| |
133 gtk_widget_shape_combine_mask(win, bitmap, 0, 0); |
| |
134 |
| |
135 g_object_unref(G_OBJECT(pixmap)); |
| |
136 g_object_unref(G_OBJECT(bitmap)); |
| |
137 |
| |
138 gtk_widget_show_all(pix); |
| |
139 |
| |
140 return win; |
| |
141 } |
| |
142 |
| |
143 #endif |
| 105 |
144 |
| 106 static void |
145 static void |
| 107 get_widget_coords(GtkWidget *w, gint *x1, gint *y1, gint *x2, gint *y2) |
146 get_widget_coords(GtkWidget *w, gint *x1, gint *y1, gint *x2, gint *y2) |
| 108 { |
147 { |
| 109 gint ox, oy, width, height; |
148 gint ox, oy, width, height; |