2009-05-17
* Added support for the Lua programming language
+ * Added support for rending images by way of IMLIB2
2009-05-11
* Added arguments to hwmon for value precalculation
<option><path to image> (-p x,y) (-s WxH)</option>
</term>
<listitem>
- Renders an image from the path specified using IMLIB2. Takes 2 optional arguments, one being a position, the other an size. Changing the x,y position will move the position of the image, and changing the WxH will scale the image. Example: ${image /home/brenden/cheeseburger.jpg -p 20,20 -s 200x200} will render 'cheeseburger.jpg' at (20,20) scaled to 200x200 pixels.
+ Renders an image from the path specified using IMLIB2. Takes 2 optional arguments, one being a position, the other an size. Changing the x,y position will move the position of the image, and changing the WxH will scale the image. Example: ${image /home/brenden/cheeseburger.jpg -p 20,20 -s 200x200} will render 'cheeseburger.jpg' at (20,20) scaled to 200x200 pixels. Conky does not make any attempt to adjust the position (or any other formatting) of images, they are just rendered as per the arguments passed. The only reason $image is part of the TEXT section, is to allow for runtime modifications, through $execp $lua_parse, $lua_read_parse, or some other method.
<para></para></listitem>
</varlistentry>
XftDrawSetClip(window.xftdraw, region);
}
#endif
+#ifdef IMLIB2
+ cimlib_render(text_start_x + border_margin, text_start_y + border_margin, window.width, window.height);
+#endif /* IMLIB2 */
draw_stuff();
XDestroyRegion(region);
region = XCreateRegion();
-#ifdef IMLIB2
- cimlib_event_end(text_start_x + border_margin, text_start_y + border_margin, window.width, window.height);
-#endif /* IMLIB2 */
}
} else {
#endif /* X11 */
image = imlib_load_image(cur->name);
if (image) {
int w, h;
- DBGP("Drawing image '%s'", cur->name);
+ DBGP("Drawing image '%s' at (%i,%i) scaled to %ix%i", cur->name, cur->x, cur->y, cur->w, cur->h);
imlib_context_set_image(image);
w = imlib_image_get_width();
h = imlib_image_get_height();
}
}
-void cimlib_event_end(int x, int y, int width, int height)
+void cimlib_render(int x, int y, int width, int height)
{
if (!image_list_start) return; /* are we actually drawing anything? */
/* take all the little rectangles to redraw and merge them into
* something sane for rendering */
buffer = imlib_create_image(width, height);
+ /* clear our buffer */
+ imlib_context_set_image(buffer);
+ imlib_image_clear();
/* we can blend stuff now */
imlib_context_set_blend(1);
void cimlib_add_image(const char *name);
void cimlib_set_cache_size(long size);
void cimlib_init(Display *display, Window drawable, Visual *visual, Colormap colourmap);
-void cimlib_event_end(int x, int y, int width, int height);
+void cimlib_render(int x, int y, int width, int height);
void cimlib_cleanup(void);
#endif /* _CONKY_IMBLI2_H_ */