summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMichael Jennings <mej@kainx.org>2000-04-13 04:19:05 +0000
committerMichael Jennings <mej@kainx.org>2000-04-13 04:19:05 +0000
commitdfc718de71752636acfedb2ca84ff80a4f73538b (patch)
tree84012f841ee11219cc5dd9c2824c9ed77533cb65 /utils
parent505ae127851f43e430b8b3e85ecf9d40aa8fdb12 (diff)
downloadeterm-dfc718de71752636acfedb2ca84ff80a4f73538b.tar.gz
Wed Apr 12 21:18:19 PDT 2000 Michael Jennings <mej@eterm.org>
This is the initial commit with Imlib2 support. READ THIS CAREFULLY. There is important information in this commit message that will keep you from getting screwed. First off, support for Imlib 1.x is GONE. It is no longer supported as of now. If you want to continue using it, do NOT install this version. I tried to support both for awhile, but the code ended up being way too ugly and hackish. Imlib2 is the future. And trust me, when you see what we do with this future, you'll be happy for the switch. The good news is that most of the basics work. Transparency still works, and the basic image stuff works. Most users won't notice any major problems, so long as your Imlib2 is 100% up-to-date. However, a few things still don't work: 1. Auto mode is a bit broken. You'll get X errors in XFree86 4.0. Don't use it if you're running XFree 4. 2. Color modifiers for images don't work. At all. 3. Transparency shading/tinting will not work in 8bpp or lower. Life blows sometimes. Sorry. Time for a real video card. :-) 4. The built-in icon is broken. 5. You WILL need to update your theme.cfg files. The borders on the horizontal and vertical bar images were incorrect when combined with the new anti-aliased scaling. The horizontal bars should have a right border of 3. Vertical bars should have a bottom border of 3. The menu images should have both right *and* bottom borders of 3. You can either make those changes by hand, or use the --with-theme-update option to autogen.sh. Your call. I think that covers everything I've run into. I will point out that I don't really take advantage of a lot of the Imlib2 features just yet. My first priority is to make all the stuff that worked before work again (or at least the important stuff). Then I'll work on new features. So there it is. If you're not ready for it, don't use it. But if you are, I hope you like it. SVN revision: 2478
Diffstat (limited to 'utils')
-rw-r--r--utils/Esetroot.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/utils/Esetroot.c b/utils/Esetroot.c
index f51cb29..afbed25 100644
--- a/utils/Esetroot.c
+++ b/utils/Esetroot.c
@@ -21,7 +21,7 @@ static const char cvs_ident[] = "$Id$";
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xos.h>
-#include <Imlib.h>
+#include <Imlib2.h>
void set_pixmap_property(Pixmap p);
@@ -96,9 +96,7 @@ main(int argc, char *argv[])
unsigned char scale = 0, center = 0, fit = 0;
char *displayname = NULL;
char *fname = NULL;
- ImlibData *id;
- ImlibImage *im;
- ImlibInitParams params;
+ Imlib_Image im;
Pixmap p, temp_pmap;
register unsigned char i;
GC gc;
@@ -166,28 +164,22 @@ main(int argc, char *argv[])
fprintf(stderr, "%s:%d: Root window is 0x%08x\n", __FILE__, __LINE__, (unsigned int) Xroot);
fprintf(stderr, "%s:%d: Found screen information at %8p\n", __FILE__, __LINE__, scr);
}
- params.flags = PARAMS_VISUALID;
- params.visualid = (DefaultVisual(Xdisplay, screen))->visualid;
- id = Imlib_init_with_params(Xdisplay, &params);
- if (id == NULL) {
- fprintf(stderr, "%s: Unable to initialize Imlib.\n", *argv);
- exit(1);
- } else if (debug) {
- fprintf(stderr, "%s:%d: The Imlib Data is at %8p\n", __FILE__, __LINE__, id);
- }
- im = Imlib_load_image(id, fname);
+ imlib_context_set_display(Xdisplay);
+ imlib_context_set_visual(DefaultVisual(Xdisplay, DefaultScreen(Xdisplay)));
+ im = imlib_load_image(fname);
if (im == NULL) {
fprintf(stderr, "%s: Unable to load image file \"%s\".\n", *argv, fname);
exit(1);
} else if (debug) {
fprintf(stderr, "%s:%d: The Imlib Image is at %8p\n", __FILE__, __LINE__, im);
}
+ imlib_context_set_image(im);
if (scale) {
w = scr->width;
h = scr->height;
} else {
- w = im->rgb_width;
- h = im->rgb_height;
+ w = imlib_image_get_width();
+ h = imlib_image_get_height();
}
if (fit) {
double x_ratio, y_ratio;
@@ -219,8 +211,10 @@ main(int argc, char *argv[])
fprintf(stderr, "%s:%d: Created %dx%d+%d+%d pixmap 0x%08x\n", __FILE__, __LINE__, scr->width, scr->height, x, y, (unsigned int) p);
fprintf(stderr, "%s:%d: Applied Graphics Context %8p to pixmap.\n", __FILE__, __LINE__, gc);
}
- Imlib_render(id, im, w, h);
- temp_pmap = Imlib_move_image(id, im);
+ imlib_context_set_anti_alias(1);
+ imlib_context_set_dither(1);
+ imlib_context_set_blend(0);
+ imlib_render_pixmaps_for_whole_image_at_size(&temp_pmap, NULL, 0, w, h);
if (debug) {
fprintf(stderr, "%s:%d: Rendered at %dx%d onto pixmap 0x%08x\n", __FILE__, __LINE__, w, h, (unsigned int) temp_pmap);
}