#include <X11/extensions/Xdamage.h>
#endif
#ifdef IMLIB2
-#include <Imlib2.h>
+#include "imlib2.h"
#endif /* IMLIB2 */
#endif /* X11 */
#include <sys/types.h>
#endif /* IBM */
#ifdef NVIDIA
" * nvidia\n"
-#endif
+#endif /* NVIDIA */
#ifdef EVE
" * eve-online\n"
#endif /* EVE */
#ifdef CONFIG_OUTPUT
" * config-output\n"
#endif /* CONFIG_OUTPUT */
+#ifdef IMLIB2
+ " * IMLIB2\n"
+#endif /* IMLIB2 */
#ifdef MIXER_IS_ALSA
" * ALSA mixer support\n"
#endif /* MIXER_IS_ALSA */
strcpy(p, "0.0.0.0");
}
#endif /* __linux__ */
-
#if defined(IMLIB2) && defined(X11)
OBJ(image) {
- if (obj->a < 1) {
- obj->a++;
- } else {
- Imlib_Image image, buffer;
-
- image = imlib_load_image(obj->data.s);
- imlib_context_set_image(image);
- if (image) {
- int w, h;
-
- w = imlib_image_get_width();
- h = imlib_image_get_height();
- buffer = imlib_create_image(w, h);
- imlib_context_set_display(display);
- imlib_context_set_drawable(window.drawable);
- imlib_context_set_colormap(DefaultColormap(display,
- screen));
- imlib_context_set_visual(DefaultVisual(display,
- screen));
- imlib_context_set_image(buffer);
- imlib_blend_image_onto_image(image, 0, 0, 0, w, h,
- text_start_x, text_start_y, w, h);
- imlib_render_image_on_drawable(text_start_x,
- text_start_y);
- imlib_free_image();
- imlib_context_set_image(image);
- imlib_free_image();
- }
- }
+ /* doesn't actually draw anything, just queues it omp. the
+ * image will get drawn after the X event loop */
+ cimlib_add_image(obj->data.s);
}
#endif /* IMLIB2 */
-
OBJ(eval) {
struct information *tmp_info;
struct text_object subroot, subroot2;
/* update_text() generates new text and clears old text area */
static void update_text(void)
{
+#ifdef IMLIB2
+ cimlib_cleanup();
+#endif /* IMLIB2 */
generate_text();
#ifdef X11
if (output_methods & TO_X)
if (output_methods & TO_X) {
XFlush(display);
+#ifdef IMLIB2
+ cimlib_event_start();
+#endif /* IMLIB2 */
+
/* wait for X event or timeout */
if (!XPending(display)) {
r.width = ev.xexpose.width;
r.height = ev.xexpose.height;
XUnionRectWithRegion(&r, region, region);
+#ifdef IMLIB2
+ cimlib_event_expose(&ev);
+#endif /* IMLIB2 */
break;
}
}
#endif
draw_stuff();
+#ifdef IMLIB2
+ cimlib_event_end(/*window.x, window.y, */0, 0, window.width, window.height);
+#endif /* IMLIB2 */
XDestroyRegion(region);
region = XCreateRegion();
}
XFreeGC(display, window.gc);
free_fonts();
}
+
#endif /* X11 */
free_text_objects(&global_root_object);
stippled_borders = 4;
}
}
+ CONF("imlib_cache_size") {
+ if (value) {
+ cimlib_set_cache_size(atoi(value));
+ }
+ }
#endif /* X11 */
CONF("update_interval") {
if (value) {