1
#include "gtk-window-decorator.h"
4
pixmap_new_from_pixbuf (GdkPixbuf *pixbuf, int depth)
10
width = gdk_pixbuf_get_width (pixbuf);
11
height = gdk_pixbuf_get_height (pixbuf);
13
pixmap = create_pixmap (width, height, depth);
17
cr = (cairo_t *) gdk_cairo_create (GDK_DRAWABLE (pixmap));
18
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
19
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
28
gdk_cairo_set_source_color_alpha (cairo_t *cr,
32
cairo_set_source_rgba (cr,
34
color->green / 65535.0,
35
color->blue / 65535.0,
40
create_gdk_window (Window xframe)
42
GdkDisplay *display = gdk_display_get_default ();
43
GdkScreen *screen = gdk_display_get_default_screen (display);
44
GdkWindow *window = gdk_window_foreign_new (xframe);
45
GdkColormap *cmap = gdk_screen_get_rgb_colormap (screen);
47
gdk_drawable_set_colormap (GDK_DRAWABLE (window), cmap);
53
get_colormap_for_drawable (GdkDrawable *d)
55
GdkDisplay *display = gdk_display_get_default ();
56
GdkScreen *screen = gdk_display_get_default_screen (display);
58
if (gdk_drawable_get_depth (d) == 32)
59
return gdk_screen_get_rgba_colormap (screen);
61
return gdk_screen_get_rgb_colormap (screen);
65
get_format_for_drawable (decor_t *d, GdkDrawable *drawable)
67
if (!d->frame_window || gdk_drawable_get_depth (drawable) == 32)
84
widget = (depth > 24) ? style_window_rgba : style_window_rgb;
85
window = gtk_widget_get_window (widget);
86
return gdk_pixmap_new (GDK_DRAWABLE (window), w, h, depth);
b'\\ No newline at end of file'