27 cairo_status_t
png_stream_reader (
void *_stream,
unsigned char *data,
unsigned int length) {
31 return CAIRO_STATUS_SUCCESS;
36 png_stream.
data = name;
38 return cairo_image_surface_create_from_png_stream(&
png_stream_reader, (
void *)&png_stream);
43 int width = cairo_image_surface_get_width(getpng);
44 int height = cairo_image_surface_get_height(getpng);
45 cairo_surface_destroy(w->
image);
49 CAIRO_CONTENT_COLOR_ALPHA, width, height);
50 cairo_t *cri = cairo_create (w->
image);
51 cairo_set_source_surface (cri, getpng,0,0);
53 cairo_surface_destroy(getpng);
59 int width = cairo_image_surface_get_width(getpng);
60 int height = cairo_image_surface_get_height(getpng);
63 double x = (double)width_t/(
double)width;
64 double y = (double)height_t/(
double)height;
65 cairo_surface_destroy(w->
image);
69 CAIRO_CONTENT_COLOR_ALPHA, width_t, height_t);
70 cairo_t *cri = cairo_create (w->
image);
71 cairo_scale(cri, x,y);
72 cairo_set_source_surface (cri, getpng,0,0);
74 cairo_surface_destroy(getpng);
85 int width = cairo_image_surface_get_width(getpng);
86 int height = cairo_image_surface_get_height(getpng);
88 sf = cairo_surface_create_similar (w->
surface,
89 CAIRO_CONTENT_COLOR_ALPHA, width, height);
90 cairo_t *cri = cairo_create (sf);
91 cairo_set_source_surface (cri, getpng,0,0);
93 cairo_surface_destroy(getpng);
99 int width = cairo_xlib_surface_get_width(image);
100 int height = cairo_xlib_surface_get_height(image);
101 XWindowAttributes atr;
103 Pixmap icon = XCreatePixmap(w->
app->
dpy, w->
widget, width, height, atr.depth);
104 cairo_surface_t *surface = cairo_xlib_surface_create (w->
app->
dpy, icon,
105 DefaultVisual(w->
app->
dpy, DefaultScreen(w->
app->
dpy)), width, height);
106 cairo_t *cri = cairo_create (surface);
108 cairo_set_source_rgba(cri, c->
bg[0], c->
bg[1], c->
bg[2], c->
bg[3]);
110 cairo_set_source_surface (cri, image,0,0);
112 cairo_surface_destroy(surface);
116 XWMHints* win_hints = XAllocWMHints();
118 win_hints->flags = IconPixmapHint;
119 win_hints->icon_pixmap = icon;
126 int width = cairo_image_surface_get_width(image);
127 int height = cairo_image_surface_get_height(image);
128 XWindowAttributes atr;
130 Pixmap icon = XCreatePixmap(w->
app->
dpy, w->
widget, width, height, atr.depth);
131 cairo_surface_t *surface = cairo_xlib_surface_create (w->
app->
dpy, icon,
132 DefaultVisual(w->
app->
dpy, DefaultScreen(w->
app->
dpy)), width, height);
133 cairo_t *cri = cairo_create (surface);
135 cairo_set_source_rgba(cri, c->
bg[0], c->
bg[1], c->
bg[2], c->
bg[3]);
137 cairo_set_source_surface (cri, image,0,0);
139 cairo_surface_destroy(image);
140 cairo_surface_destroy(surface);
144 XWMHints* win_hints = XAllocWMHints();
146 win_hints->flags = IconPixmapHint;
147 win_hints->icon_pixmap = icon;