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
This commit is contained in:
Michael Jennings 2000-04-13 04:19:05 +00:00
parent 505ae12785
commit dfc718de71
29 changed files with 464 additions and 1493 deletions

View File

@ -3431,3 +3431,50 @@ Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
Hopefully this will make more people happy. :-)
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

View File

@ -330,6 +330,7 @@
#undef KS_END
#undef CONFIG_BUFF
#undef PKGDATADIR
#undef HAVE_LIBIMLIB2
/* Leave that blank line there!! Autoheader needs it.

View File

@ -278,26 +278,33 @@ AC_ARG_WITH(imlib,
[ --with-imlib[=DIR] compile with Imlib support (Imlib residing in DIR/lib) (default)],
if test "$withval" != "no"; then
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -I${withval}/include -L${withval}/lib"
GRLIBS="-lImlib"
AC_DEFINE(PIXMAP_SUPPORT)
AC_DEFINE(BACKING_STORE)
if test "$withval" != "yes"; then
CFLAGS="$CFLAGS -I${withval}/include"
LDFLAGS="$LDFLAGS -L${withval}/lib"
fi
USE_IMLIB=1
else
AC_MSG_RESULT(no)
GRLIBS=""
USE_IMLIB=0
fi, AC_MSG_RESULT(yes)
GRLIBS="-lImlib"
AC_DEFINE(PIXMAP_SUPPORT)
AC_DEFINE(BACKING_STORE)
USE_IMLIB=1
)
if test $USE_IMLIB -eq 1 ; then
AC_CHECK_LIB(Imlib2, imlib_create_image,
GRLIBS="-lImlib2"
AC_CHECK_LIB(dl, dlopen, GRLIBS="$GRLIBS -ldl", , $SUBLIBS $X_LIBS)
AC_DEFINE(PIXMAP_SUPPORT)
AC_DEFINE(BACKING_STORE)
,
, $SUBLIBS $X_LIBS)
fi
AC_MSG_CHECKING(for transparency support)
AC_ARG_ENABLE(trans,
[ --enable-trans[=imlib] compile with transparency support (\"=imlib\" will use Imlib instead of Xlib for transparency)],
if test "$enableval" = "imlib"; then
AC_MSG_RESULT(yes, using Imlib)
AC_DEFINE(PIXMAP_OFFSET)
AC_DEFINE(IMLIB_TRANS)
elif test "$enableval" != "no"; then
[ --enable-trans compile with transparency support],
if test "$enableval" != "no"; then
AC_MSG_RESULT(yes)
AC_DEFINE(PIXMAP_OFFSET)
else
@ -518,7 +525,8 @@ AC_ARG_ENABLE(greek,
CONFIG_BUFF_SIZE=20480
AC_MSG_CHECKING(for the buffer size of the config file parser)
AC_ARG_WITH(config-buffer-size,
[ --config-buffer-size specifies the size of the buffer Eterm uses for parsing the config file (default is 20 Kb)],
[ --with-config-buffer-size
specifies the size of the buffer Eterm uses for parsing the config file (default is 20 Kb)],
if test "$withval" != "yes" -a "$withval" != "no"; then
CONFIG_BUFF_SIZE=$withval
fi)
@ -527,9 +535,7 @@ AC_DEFINE_UNQUOTED(CONFIG_BUFF, $CONFIG_BUFF_SIZE)
AC_ARG_WITH(terminfo,
[ --without-terminfo do not compile the Eterm terminfo file],
if test "$withval" = "yes"; then
:
else
if test "$withval" = "no"; then
TIC=true
fi)
@ -595,61 +601,6 @@ if test "$XIM" = "TRUE"; then
AC_CHECK_LIB(X11, XRegisterIMInstantiateCallback, AC_DEFINE(USE_X11R6_XIM), , $X_LIBS $SUBLIBS)
fi
if test -z "$PIXMAPSED"; then
AC_CHECK_PROG(IMLIB_CONFIG, imlib-config, imlib-config, no)
if test "$IMLIB_CONFIG" != "no"; then
if test "$prefix" = "NONE"; then
AC_MSG_CHECKING(imlib-config for prefix)
prefix="`$IMLIB_CONFIG --prefix`"
AC_MSG_RESULT($prefix)
fi
AC_MSG_CHECKING(imlib-config for the value of CFLAGS)
CFLAGS="$CFLAGS `$IMLIB_CONFIG --cflags`"
AC_MSG_RESULT($CFLAGS)
AC_MSG_CHECKING(imlib-config for the value of GRLIBS)
GRLIBS="$GRLIBS `$IMLIB_CONFIG --libs`"
AC_MSG_RESULT($GRLIBS)
SAVE_LIBS="$LIBS"
LIBS="$GRLIBS"
AC_MSG_CHECKING(the sanity of new compile/link flags)
AC_TRY_LINK(, , echo "yes", echo "no" ; IMLIB_CONFIG="no" ;
AC_WARN(Compile/link failed. Reverting to manual method.)
)
LIBS="$SAVE_LIBS"
fi
if test "$IMLIB_CONFIG" = "no"; then
AC_CHECK_LIB(png, png_get_valid, GRLIBS="$GRLIBS -lpng -lz -lm", ,
$SUBLIBS $X_LIBS -lz -lm)
AC_CHECK_LIB(jpeg, jpeg_read_scanlines, GRLIBS="$GRLIBS -ljpeg", ,
$SUBLIBS $X_LIBS)
AC_CHECK_LIB(tiff, TIFFOpen, GRLIBS="$GRLIBS -ltiff", ,
$SUBLIBS $X_LIBS -lm)
AC_CHECK_LIB(gif, DGifOpenFileName, GRLIBS="$GRLIBS -lgif", ,
$SUBLIBS $X_LIBS)
AC_CHECK_LIB(ungif, DGifOpenFileName, GRLIBS="$GRLIBS -lungif", ,
$SUBLIBS $X_LIBS)
AC_CHECK_LIB(Imlib, Imlib_init, , [
echo "WARNING: Imlib was not found or did not correctly link.";
echo " Please check config.log to see what the error was.";
echo " I will attempt to continue, but things may go wrong.";
AC_MSG_WARN([WARNING: libImlib not found. Attempting to continue anyway.])],
$GRLIBS $SUBLIBS $X_LIBS)
fi
fi
AC_PREFIX(Eterm)
AC_PREFIX(gcc)
if test "$prefix" = "NONE"; then

View File

@ -274,7 +274,7 @@ unsigned short
bbar_calc_height(buttonbar_t *bbar)
{
button_t *b;
ImlibBorder *bbord = images[image_bbar].norm->iml->border, *bord = images[image_button].norm->iml->border;
Imlib_Border *bbord = images[image_bbar].norm->iml->border, *bord = images[image_button].norm->iml->border;
D_BBAR(("bbar_calc_height(%8p): fascent == %d, fdescent == %d, h == %d\n", bbar, bbar->fascent, bbar->fdescent, bbar->h));
@ -321,7 +321,7 @@ bbar_calc_positions(buttonbar_t *bbar)
{
button_t *b;
unsigned short x, y;
ImlibBorder *border = images[image_bbar].norm->iml->border;
Imlib_Border *border = images[image_bbar].norm->iml->border;
D_BBAR(("bbar == %8p\n", bbar));
@ -351,7 +351,7 @@ bbar_calc_positions(buttonbar_t *bbar)
void
button_calc_size(buttonbar_t *bbar, button_t *button)
{
ImlibBorder *bord = images[image_button].norm->iml->border;
Imlib_Border *bord = images[image_button].norm->iml->border;
int ascent, descent, direction;
XCharStruct chars;
@ -379,8 +379,9 @@ button_calc_size(buttonbar_t *bbar, button_t *button)
if (bord) {
b = button->h - bord->top - bord->bottom;
}
button->icon_w = button->icon->iml->im->rgb_width;
button->icon_h = button->icon->iml->im->rgb_height;
imlib_context_set_image(button->icon->iml->im);
button->icon_w = imlib_image_get_width();
button->icon_h = imlib_image_get_height();
D_BBAR((" -> Initial icon dimensions are %hux%hu\n", button->icon_w, button->icon_h));
if (button->icon_h > b) {
button->icon_w = (unsigned short) ((float) button->icon_w / button->icon_h * b);
@ -398,7 +399,7 @@ button_calc_size(buttonbar_t *bbar, button_t *button)
void
button_calc_rel_coords(buttonbar_t *bbar, button_t *button)
{
ImlibBorder *bord = images[image_button].norm->iml->border;
Imlib_Border *bord = images[image_button].norm->iml->border;
D_BBAR(("bbar == %8p, button == %8p\n", bbar, button));

View File

@ -132,6 +132,10 @@ static const char cvs_ident[] = "$Id$";
#endif
#include "windows.h"
static RETSIGTYPE handle_child_signal(int);
static RETSIGTYPE handle_exit_signal(int);
static RETSIGTYPE handle_crash(int);
/* local variables */
int my_ruid, my_euid, my_rgid, my_egid;
char initial_dir[PATH_MAX + 1];
@ -247,11 +251,6 @@ privileges(int mode)
char *
sig_to_str(int sig)
{
/* NOTE: This can't be done with a switch because of possible conflicting
* conflicting signal types. -vendu
*/
#ifdef SIGHUP
if (sig == SIGHUP) {
return ("SIGHUP");
@ -1012,8 +1011,8 @@ dump_stack_trace(void)
/*
* Catch a SIGCHLD signal and exit if the direct child has died
*/
RETSIGTYPE
Child_signal(int sig)
static RETSIGTYPE
handle_child_signal(int sig)
{
int pid, save_errno = errno;
@ -1043,15 +1042,15 @@ Child_signal(int sig)
}
errno = save_errno;
D_CMD(("Child_signal: installing signal handler\n"));
signal(SIGCHLD, Child_signal);
D_CMD(("handle_child_signal: installing signal handler\n"));
signal(SIGCHLD, handle_child_signal);
SIG_RETURN(0);
}
/* Handles signals usually sent by a user, like HUP, TERM, INT. */
RETSIGTYPE
Exit_signal(int sig)
static RETSIGTYPE
handle_exit_signal(int sig)
{
print_error("Received terminal signal %s (%d)", sig_to_str(sig), sig);
@ -1070,7 +1069,7 @@ Exit_signal(int sig)
/* Handles abnormal termination signals -- mej */
static RETSIGTYPE
SegvHandler(int sig)
handle_crash(int sig)
{
print_error("Received terminal signal %s (%d)", sig_to_str(sig), sig);
@ -1088,6 +1087,24 @@ SegvHandler(int sig)
SIG_RETURN(0);
}
void
install_handlers(void)
{
signal(SIGHUP, handle_exit_signal);
#ifndef __svr4__
signal(SIGINT, handle_exit_signal);
#endif
signal(SIGQUIT, handle_crash);
signal(SIGTERM, handle_exit_signal);
signal(SIGCHLD, handle_child_signal);
signal(SIGSEGV, handle_crash);
signal(SIGBUS, handle_crash);
signal(SIGABRT, handle_crash);
signal(SIGFPE, handle_crash);
signal(SIGILL, handle_crash);
signal(SIGSYS, handle_crash);
}
/*
* Exit gracefully, clearing the utmp entry and restoring tty attributes
* TODO: Also free up X resources, etc., if possible
@ -1116,6 +1133,7 @@ clean_exit(void)
#endif
privileges(REVERT);
PABLO_STOP_TRACING();
DPRINTF1(("Cleanup done. I am outta here!\n"));
}
/* Acquire a pseudo-teletype from the system. */
@ -2062,24 +2080,6 @@ run_command(char *argv[])
}
#endif
/* spin off the command interpreter */
signal(SIGHUP, Exit_signal);
#ifndef __svr4__
signal(SIGINT, Exit_signal);
#endif
signal(SIGQUIT, SegvHandler);
signal(SIGTERM, Exit_signal);
signal(SIGCHLD, Child_signal);
signal(SIGSEGV, SegvHandler);
signal(SIGBUS, SegvHandler);
signal(SIGABRT, SegvHandler);
signal(SIGFPE, SegvHandler);
signal(SIGILL, SegvHandler);
signal(SIGSYS, SegvHandler);
/* need to trap SIGURG for SVR4 (Unixware) rlogin */
/* signal (SIGURG, SIG_DFL); */
D_CMD(("Forking\n"));
cmd_pid = fork();
D_CMD(("After fork(), cmd_pid == %d\n", cmd_pid));
@ -2343,7 +2343,8 @@ check_pixmap_change(int sig)
D_PIXMAP(("now %lu >= %lu (last_update %lu + rs_anim_delay %lu) ?\n", now, last_update + rs_anim_delay, last_update, rs_anim_delay));
if (now >= last_update + rs_anim_delay || 1) {
D_PIXMAP(("Time to update pixmap. now == %lu\n", now));
Imlib_destroy_image(imlib_id, images[image_bg].current->iml->im);
imlib_context_set_image(images[image_bg].current->iml->im);
imlib_free_image_and_decache();
images[image_bg].current->iml->im = NULL;
xterm_seq(XTerm_Pixmap, rs_anim_pixmaps[image_idx++]);
last_update = now;

View File

@ -342,8 +342,7 @@ extern char *sig_to_str(int);
extern const char *event_type_to_name(int);
extern const char *request_code_to_name(int);
extern void dump_stack_trace(void);
extern RETSIGTYPE Child_signal(int);
extern RETSIGTYPE Exit_signal(int);
extern void install_handlers(void);
extern void clean_exit(void);
extern int get_pty(void);
extern int get_tty(void);

View File

@ -33,17 +33,28 @@
extern unsigned int debug_level;
/* Assert macros stolen from my work on Ebar. If these macros break with your cpp, let me know -- mej@eterm.org */
/* A NOP. Does nothing. */
# define NOP ((void)0)
/* A macro and an #undef to FIXME-ize individual calls or entire code blocks. */
# define FIXME_NOP(x)
# undef FIXME_BLOCK
/* The basic debugging output leader. */
#if defined(__FILE__) && defined(__LINE__)
# ifdef __GNUC__
# define __DEBUG() fprintf(stderr, "[%lu] %12s | %4d: %s(): ", (unsigned long) time(NULL), __FILE__, __LINE__, __FUNCTION__)
# else
# define __DEBUG() fprintf(stderr, "[%lu] %12s | %4d: ", (unsigned long) time(NULL), __FILE__, __LINE__)
# endif
#else
# define __DEBUG() NOP
#endif
/* A quick and dirty macro to say, "Hi! I got here without crashing!" */
# define MOO() do { __DEBUG(); fprintf(stderr, "Moo.\n"); fflush(stderr); } while (0)
/* Assertion/abort macros which are quite a bit more useful than assert() and abort(). */
#if defined(__FILE__) && defined(__LINE__)
# ifdef __GNUC__
# define ASSERT(x) do {if (!(x)) {if (debug_level>=1) {fatal_error("ASSERT failed in %s() at %s:%d: %s", __FUNCTION__, __FILE__, __LINE__, #x);} \
@ -82,10 +93,6 @@ extern unsigned int debug_level;
# define ABORT() fatal_error("Aborting.")
#endif
#ifndef __DEBUG
# define __DEBUG() NOP
#endif
#define REQUIRE(x) do {if (!(x)) {if (debug_level>=1) {__DEBUG(); real_dprintf("REQUIRE failed: %s\n", #x);} return;}} while (0)
#define REQUIRE_RVAL(x, v) do {if (!(x)) {if (debug_level>=1) {__DEBUG(); real_dprintf("REQUIRE failed: %s\n", #x);} return (v);}} while (0)
#define NONULL(x) ((x) ? (x) : ("<null>"))

View File

@ -1,822 +0,0 @@
/* XPM */
static char * Eterm_xpm[] = {
"48 48 771 2",
" c None",
". c #282722",
"+ c #2E2C27",
"@ c #33332C",
"# c #3A382F",
"$ c #403E36",
"% c #44433B",
"& c #47463C",
"* c #515048",
"= c #58584E",
"- c #5B5B52",
"; c #757469",
"> c #918F83",
", c #8B897D",
"' c #7F7E70",
") c #807E6F",
"! c #878576",
"~ c #8C8C7A",
"{ c #010103",
"] c #020204",
"^ c #32322B",
"/ c #3B382E",
"( c #434035",
"_ c #48473D",
": c #505044",
"< c #565647",
"[ c #5A584A",
"} c #5B5B4A",
"| c #5C5B4D",
"1 c #5E5B50",
"2 c #5E5C50",
"3 c #6D6A5C",
"4 c #757362",
"5 c #787764",
"6 c #7D7B6B",
"7 c #81806F",
"8 c #848372",
"9 c #888675",
"0 c #949484",
"a c #A8A796",
"b c #B3B3A0",
"c c #B9B6A4",
"d c #B4B39F",
"e c #A6A592",
"f c #959482",
"g c #928F7E",
"h c #92917E",
"i c #928F7D",
"j c #3B3A32",
"k c #454337",
"l c #71705B",
"m c #706F5B",
"n c #6C6C5A",
"o c #727261",
"p c #757263",
"q c #757363",
"r c #757563",
"s c #787563",
"t c #787663",
"u c #787863",
"v c #797963",
"w c #7C7969",
"x c #7C7C69",
"y c #7D7C6B",
"z c #7D7D6B",
"A c #7E7D6B",
"B c #807D6B",
"C c #827F6C",
"D c #848270",
"E c #8F8B7D",
"F c #A7A693",
"G c #B2B1A0",
"H c #B6B3A2",
"I c #B6B6A2",
"J c #B3B1A0",
"K c #ADAA99",
"L c #9A9988",
"M c #8C8979",
"N c #8D8A7A",
"O c #8D8D7A",
"P c #8D8B7B",
"Q c #3E3E34",
"R c #34342C",
"S c #726E5C",
"T c #72705E",
"U c #6A6A56",
"V c #72705C",
"W c #71705C",
"X c #716F5E",
"Y c #6D6D5B",
"Z c #6C6B5B",
"` c #6A6758",
" . c #69695A",
".. c #656556",
"+. c #666656",
"@. c #615F53",
"#. c #5F5E4F",
"$. c #5E5D50",
"%. c #5C5950",
"&. c #5C5B4E",
"*. c #59574C",
"=. c #5A594C",
"-. c #5C5D50",
";. c #727166",
">. c #807D71",
",. c #818176",
"'. c #808078",
"). c #7D7D74",
"!. c #777770",
"~. c #6F6E66",
"{. c #5C5C56",
"]. c #717162",
"^. c #8A8874",
"/. c #8A8876",
"(. c #8A8A78",
"_. c #3B3B34",
":. c #706F5D",
"<. c #515044",
"[. c #30312A",
"}. c #2E2D26",
"|. c #2C2B26",
"1. c #2A2A24",
"2. c #282824",
"3. c #272926",
"4. c #252523",
"5. c #262421",
"6. c #232221",
"7. c #282625",
"8. c #232321",
"9. c #212420",
"0. c #1A1919",
"a. c #141411",
"b. c #111214",
"c. c #171616",
"d. c #2C2B2F",
"e. c #404040",
"f. c #484746",
"g. c #4C4C4C",
"h. c #494949",
"i. c #4A4A4A",
"j. c #414146",
"k. c #323235",
"l. c #31312E",
"m. c #62625A",
"n. c #868574",
"o. c #878574",
"p. c #878575",
"q. c #3D3D31",
"r. c #6E6D5B",
"s. c #706E5C",
"t. c #535045",
"u. c #161610",
"v. c #13140D",
"w. c #121519",
"x. c #0B0A0F",
"y. c #0F0F0E",
"z. c #0F0F0D",
"A. c #09090A",
"B. c #060606",
"C. c #060608",
"D. c #050507",
"E. c #07080B",
"F. c #090C14",
"G. c #070708",
"H. c #07080A",
"I. c #1F211F",
"J. c #2D2D2E",
"K. c #333535",
"L. c #323234",
"M. c #343436",
"N. c #353634",
"O. c #373735",
"P. c #373736",
"Q. c #30302F",
"R. c #2B2B29",
"S. c #615F56",
"T. c #82816F",
"U. c #82816D",
"V. c #838172",
"W. c #3C3B34",
"X. c #6C6A5B",
"Y. c #6F6E5C",
"Z. c #5D5D4D",
"`. c #202712",
" + c #1B2C0C",
".+ c #0A0B11",
"++ c #0E1117",
"@+ c #0C0C0D",
"#+ c #111013",
"$+ c #131314",
"%+ c #131310",
"&+ c #101011",
"*+ c #0F1419",
"=+ c #121419",
"-+ c #12110F",
";+ c #1A1B1B",
">+ c #363634",
",+ c #313130",
"'+ c #313131",
")+ c #2F2F31",
"!+ c #343334",
"~+ c #343534",
"{+ c #343433",
"]+ c #333434",
"^+ c #2B2C2C",
"/+ c #232324",
"(+ c #5F5E54",
"_+ c #807F6F",
":+ c #817F6C",
"<+ c #7F7E6C",
"[+ c #434138",
"}+ c #5E5E4E",
"|+ c #6D6A5B",
"1+ c #686554",
"2+ c #101911",
"3+ c #061307",
"4+ c #0B0C09",
"5+ c #0F111D",
"6+ c #0A0D0F",
"7+ c #0A0B09",
"8+ c #0A0A0B",
"9+ c #08080A",
"0+ c #050506",
"a+ c #040405",
"b+ c #040507",
"c+ c #070B11",
"d+ c #0B0C10",
"e+ c #16151A",
"f+ c #202021",
"g+ c #232323",
"h+ c #222625",
"i+ c #292A27",
"j+ c #2B2A2C",
"k+ c #2C2B2D",
"l+ c #2B2B2C",
"m+ c #292929",
"n+ c #242424",
"o+ c #131615",
"p+ c #54584C",
"q+ c #7E7B6C",
"r+ c #7E7E6C",
"s+ c #44443A",
"t+ c #424238",
"u+ c #6D6B5B",
"v+ c #171815",
"w+ c #030203",
"x+ c #040709",
"y+ c #07081E",
"z+ c #01030A",
"A+ c #02070C",
"B+ c #010204",
"C+ c #03030C",
"D+ c #03030B",
"E+ c #010107",
"F+ c #020213",
"G+ c #020208",
"H+ c #040715",
"I+ c #0E0F18",
"J+ c #141412",
"K+ c #1A1A1A",
"L+ c #1E1C21",
"M+ c #202022",
"N+ c #222224",
"O+ c #252524",
"P+ c #242422",
"Q+ c #222120",
"R+ c #1A1D1C",
"S+ c #0F100F",
"T+ c #55544A",
"U+ c #7A7964",
"V+ c #7A7968",
"W+ c #404038",
"X+ c #6A6A57",
"Y+ c #6C6B59",
"Z+ c #22241E",
"`+ c #040403",
" @ c #030506",
".@ c #04090C",
"+@ c #010303",
"@@ c #03060F",
"#@ c #03030D",
"$@ c #030314",
"%@ c #020306",
"&@ c #02030B",
"*@ c #0A1016",
"=@ c #131A1F",
"-@ c #141717",
";@ c #181814",
">@ c #1D1C18",
",@ c #1E1D20",
"'@ c #202020",
")@ c #202026",
"!@ c #1F1E1D",
"~@ c #1C1D1E",
"{@ c #151515",
"]@ c #0D0F0F",
"^@ c #54544C",
"/@ c #787668",
"(@ c #787664",
"_@ c #7A7664",
":@ c #434136",
"<@ c #6B6A57",
"[@ c #6D695B",
"}@ c #302F29",
"|@ c #020415",
"1@ c #010306",
"2@ c #06070E",
"3@ c #030608",
"4@ c #030609",
"5@ c #020307",
"6@ c #050714",
"7@ c #04030A",
"8@ c #0E0F20",
"9@ c #161834",
"0@ c #121418",
"a@ c #171816",
"b@ c #181A1B",
"c@ c #1B1B17",
"d@ c #1C1C1C",
"e@ c #1B1B1F",
"f@ c #1A191A",
"g@ c #171519",
"h@ c #100D0B",
"i@ c #07090D",
"j@ c #454945",
"k@ c #757564",
"l@ c #767668",
"m@ c #777664",
"n@ c #4A493E",
"o@ c #686753",
"p@ c #696955",
"q@ c #403F37",
"r@ c #080807",
"s@ c #050505",
"t@ c #040415",
"u@ c #05050E",
"v@ c #03060A",
"w@ c #04050D",
"x@ c #050708",
"y@ c #030305",
"z@ c #04060B",
"A@ c #02030A",
"B@ c #090916",
"C@ c #131327",
"D@ c #101012",
"E@ c #111113",
"F@ c #151213",
"G@ c #171618",
"H@ c #171714",
"I@ c #161614",
"J@ c #151614",
"K@ c #141413",
"L@ c #0F1012",
"M@ c #070707",
"N@ c #090808",
"O@ c #464339",
"P@ c #737060",
"Q@ c #727263",
"R@ c #727262",
"S@ c #47473F",
"T@ c #696958",
"U@ c #090907",
"V@ c #0D0E13",
"W@ c #0B0B09",
"X@ c #0E0E11",
"Y@ c #0B0B0C",
"Z@ c #090A0D",
"`@ c #09090E",
" # c #030504",
".# c #020205",
"+# c #060605",
"@# c #09090B",
"## c #0C0C0B",
"$# c #0E0E12",
"%# c #11120D",
"&# c #121212",
"*# c #121214",
"=# c #121311",
"-# c #0F0F12",
";# c #0B0C0A",
"># c #030304",
",# c #0C0D0D",
"'# c #4C4C42",
")# c #70705C",
"!# c #727162",
"~# c #47453D",
"{# c #545345",
"]# c #676658",
"^# c #535143",
"/# c #0C0C0A",
"(# c #121314",
"_# c #141517",
":# c #131312",
"<# c #080A08",
"[# c #060707",
"}# c #040506",
"|# c #080806",
"1# c #0A0A0A",
"2# c #0B0D0D",
"3# c #0E0E0C",
"4# c #0E0E0E",
"5# c #0A0A0C",
"6# c #060505",
"7# c #45443C",
"8# c #6F6C5A",
"9# c #726F5D",
"0# c #72715C",
"a# c #47463D",
"b# c #34342A",
"c# c #696858",
"d# c #585648",
"e# c #2E1911",
"f# c #290704",
"g# c #0E0F0C",
"h# c #090B0B",
"i# c #0C0C10",
"j# c #181919",
"k# c #0C0D0A",
"l# c #0B0D12",
"m# c #0A0D0D",
"n# c #010305",
"o# c #020304",
"p# c #0B0B0A",
"q# c #0D0B0C",
"r# c #0C0B0A",
"s# c #0A0B0E",
"t# c #0B0B0B",
"u# c #0C0C0C",
"v# c #0B0A0B",
"w# c #090905",
"x# c #050608",
"y# c #373733",
"z# c #696959",
"A# c #6E6D5C",
"B# c #4F4D43",
"C# c #323229",
"D# c #686553",
"E# c #5A594D",
"F# c #3D201B",
"G# c #480904",
"H# c #111012",
"I# c #111114",
"J# c #080A09",
"K# c #121515",
"L# c #0A0F10",
"M# c #0F1219",
"N# c #0B1217",
"O# c #010608",
"P# c #030605",
"Q# c #0E0E0F",
"R# c #111010",
"S# c #0C1011",
"T# c #090A0E",
"U# c #070706",
"V# c #060709",
"W# c #080608",
"X# c #050404",
"Y# c #030204",
"Z# c #666555",
"`# c #6E6B5C",
" $ c #6D6B5A",
".$ c #4D4D3F",
"+$ c #313129",
"@$ c #656553",
"#$ c #5E5D4D",
"$$ c #3B2B22",
"%$ c #510905",
"&$ c #181829",
"*$ c #101021",
"=$ c #161318",
"-$ c #0D0C15",
";$ c #070811",
">$ c #04040C",
",$ c #050611",
"'$ c #03040F",
")$ c #010105",
"!$ c #020103",
"~$ c #050504",
"{$ c #060604",
"]$ c #171817",
"^$ c #090908",
"/$ c #242420",
"($ c #626154",
"_$ c #6B6A5C",
":$ c #4E4B41",
"<$ c #272721",
"[$ c #605F4F",
"}$ c #616050",
"|$ c #343328",
"1$ c #300805",
"2$ c #170E0E",
"3$ c #110A0A",
"4$ c #0B0713",
"5$ c #0A0511",
"6$ c #090813",
"7$ c #0B0814",
"8$ c #0F0A1C",
"9$ c #09021C",
"0$ c #0B0320",
"a$ c #0A0329",
"b$ c #050337",
"c$ c #020240",
"d$ c #05054E",
"e$ c #0B0C4E",
"f$ c #0E0E30",
"g$ c #0D1022",
"h$ c #080B1A",
"i$ c #050812",
"j$ c #050810",
"k$ c #050711",
"l$ c #070716",
"m$ c #08080C",
"n$ c #61604F",
"o$ c #6A6A59",
"p$ c #4E4D3F",
"q$ c #1E1F1B",
"r$ c #5A5A4C",
"s$ c #646152",
"t$ c #3A392F",
"u$ c #200906",
"v$ c #150303",
"w$ c #0E0303",
"x$ c #0E0203",
"y$ c #210A03",
"z$ c #0D0203",
"A$ c #100403",
"B$ c #1B0603",
"C$ c #210503",
"D$ c #260703",
"E$ c #270803",
"F$ c #120605",
"G$ c #090909",
"H$ c #09093B",
"I$ c #020224",
"J$ c #03033A",
"K$ c #02023E",
"L$ c #030335",
"M$ c #04043A",
"N$ c #030336",
"O$ c #030324",
"P$ c #23231C",
"Q$ c #5F5F52",
"R$ c #6A6855",
"S$ c #6A6A58",
"T$ c #545348",
"U$ c #4E4D42",
"V$ c #636453",
"W$ c #424036",
"X$ c #190C09",
"Y$ c #110403",
"Z$ c #0B0103",
"`$ c #130103",
" % c #210603",
".% c #110203",
"+% c #070203",
"@% c #0B0203",
"#% c #1B0703",
"$% c #1F0603",
"%% c #0E0E10",
"&% c #04043F",
"*% c #020216",
"=% c #020229",
"-% c #020233",
";% c #020238",
">% c #020234",
",% c #020327",
"'% c #20201C",
")% c #5C5C4D",
"!% c #69685A",
"~% c #676756",
"{% c #545143",
"]% c #010102",
"^% c #4B493F",
"/% c #626454",
"(% c #4E4C3F",
"_% c #343128",
":% c #292921",
"<% c #27231D",
"[% c #281F19",
"}% c #221A13",
"|% c #1A1512",
"1% c #1A1311",
"2% c #13100F",
"3% c #17100E",
"4% c #1E100D",
"5% c #1E0C0B",
"6% c #110B09",
"7% c #080809",
"8% c #0C0D1A",
"9% c #060619",
"0% c #02020F",
"a% c #020212",
"b% c #020219",
"c% c #02021C",
"d% c #02021A",
"e% c #1B1B1A",
"f% c #59594A",
"g% c #676655",
"h% c #666657",
"i% c #000001",
"j% c #46453C",
"k% c #626254",
"l% c #5D5D4E",
"m% c #5C5C4E",
"n% c #5F5E50",
"o% c #5C5C4B",
"p% c #5A594B",
"q% c #585749",
"r% c #585447",
"s% c #515143",
"t% c #4E4C41",
"u% c #4B4B3F",
"v% c #4A453A",
"w% c #413F35",
"x% c #3D3D33",
"y% c #363442",
"z% c #312F41",
"A% c #2A293C",
"B% c #26263A",
"C% c #222238",
"D% c #1E1E2F",
"E% c #1A1A2B",
"F% c #18162A",
"G% c #161528",
"H% c #272636",
"I% c #59594F",
"J% c #686455",
"K% c #676556",
"L% c #555548",
"M% c #3A3930",
"N% c #625F4F",
"O% c #5E5E50",
"P% c #606052",
"Q% c #646254",
"R% c #636254",
"S% c #656454",
"T% c #656354",
"U% c #646454",
"V% c #636354",
"W% c #656254",
"X% c #636253",
"Y% c #605F51",
"Z% c #616051",
"`% c #5F6150",
" & c #605F50",
".& c #5D5D4F",
"+& c #5B5A53",
"@& c #595751",
"#& c #555550",
"$& c #514F4F",
"%& c #53504C",
"&& c #616052",
"*& c #636454",
"=& c #646455",
"-& c #585948",
";& c #20201D",
">& c #625F4E",
",& c #605D4D",
"'& c #626153",
")& c #626152",
"!& c #646354",
"~& c #626553",
"{& c #636553",
"]& c #595949",
"^& c #4B4941",
"/& c #524F44",
"(& c #5C5C4C",
"_& c #605E4E",
":& c #636153",
"<& c #626050",
"[& c #626051",
"}& c #5D6F4C",
"|& c #3D9F32",
"1& c #35A92D",
"2& c #59764B",
"3& c #59574B",
"4& c #4A483D",
"5& c #4F4C41",
"6& c #515043",
"7& c #565548",
"8& c #595846",
"9& c #5C5A4B",
"0& c #5F5E4E",
"a& c #5F6750",
"b& c #507F44",
"c& c #4B8640",
"d& c #5D6B4F",
"e& c #504F43",
"f& c #555546",
"g& c #535246",
"h& c #514F40",
"i& c #4F4D40",
"j& c #4C4C40",
"k& c #4D4A40",
"l& c #4A4A3F",
"m& c #49493E",
"n& c #49483E",
"o& c #4A483E",
"p& c #4A493C",
"q& c #505042",
"r& c #525242",
"s& c #555248",
"t& c #585748",
"u& c #5C5949",
"v& c #5C5B4C",
"w& c #5D5A4E",
"x& c #5E5D4E",
"y& c #5F5C4D",
"z& c #5F5E51",
"A& c #5F5F50",
"B& c #5F5E4C",
"C& c #5E5E4C",
"D& c #5D5A4A",
"E& c #5A5848",
"F& c #565445",
"G& c #535144",
"H& c #4F4E43",
"I& c #4D4D40",
"J& c #4A4A40",
"K& c #4B4A3C",
"L& c #4B4B3E",
"M& c #4E4E40",
"N& c #333329",
"O& c #2E2E27",
"P& c #303029",
"Q& c #4D4D44",
"R& c #575547",
"S& c #5C594C",
"T& c #605D4C",
"U& c #605E4C",
"V& c #5E5D4C",
"W& c #5F5D4C",
"X& c #5D5B4A",
"Y& c #5B5A4A",
"Z& c #585848",
"`& c #535345",
" * c #524F42",
".* c #3C3A34",
"+* c #414138",
"@* c #45453D",
"#* c #484638",
"$* c #464638",
"%* c #525248",
"&* c #595749",
"** c #5A584C",
"=* c #5D5D4C",
"-* c #5F5E4D",
";* c #5E5E4D",
">* c #000000",
",* c #21211D",
"'* c #23231F",
")* c #2D2D25",
"!* c #302E27",
"~* c #302E26",
"{* c #37352E",
"]* c #4C4B40",
"^* c #525144",
"/* c #5F5F5F",
"(* c #BFBFBF",
"_* c #8F8F8F",
":* c #FFFFFF",
"<* c #3F3F3F",
"[* c #6F6F6F",
"}* c #7F7F7F",
"|* c #1F1F1F",
"1* c #FEFEFE",
"2* c #2F2F2F",
"3* c #EFEFEF",
"4* c #DFDFDF",
"5* c #9F9F9F",
"6* c #0F0F0F",
" ",
" ",
" ",
" ",
" . + @ # $ % & * = - ; > , ' ) ! ~ @ { ] ",
" ^ / ( _ : < [ } | 1 2 2 3 4 5 6 7 8 9 0 a b c c d e f g h i j { ] ",
" k l m n o 4 p q r s t u v w x y z A B C D E F G H I J K L M N O P Q { ] ",
" R S T U V W X Y Z ` ...+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.{ ] ",
" W :.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.{ ] ",
" r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.C.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.{ ] ",
" X.Y.Z.`. +.+++@+#+$+%+&+y.&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+{ ] ",
" }+|+1+2+3+4+5+6+7+8+9+0+a+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+r+s+{ ] ",
" t+n u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+/+O+P+Q+R+S+T+U+V+U+W+{ ] ",
" X+Y+Z+`+ @.@+@@@] #@$@%@@@&@*@=@-@;@>@,@'@'@)@!@~@{@]@^@/@(@_@:@{ ] ",
" <@[@}@0+`+|@1@2@] 3@4@5@6@7@8@9@0@$+a@b@c@d@e@f@g@h@i@j@k@l@m@n@{ ] ",
" o@p@q@r@s@t@u@v@w@C.x@y@z@A@B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@R@S@{ ] ",
" #.T@n@U@M@V@W@X@Y@Z@`@ #.#.#+#@###$#%#&#*#$+=#-#;#>#,#'#)#!#V ~#{ ] ",
" {#]#^#/#G.(#_#:#<#[#}#] { { >#|#1#2#3#z.-#4#3#5#6#] 8+7#8#9#0#a#{ ] ",
" b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#@#t#u#v#w#x#] ] C.y#z#A#A#B#{ ] ",
" C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#r@V#W#X#Y#] ] ] . Z#`# $.${ ] ",
" +$@$#$$$%$&$*$=$-$;$>$,$'$)${ !$`+~$>#{$]$^$] ] ] ] ] /$($_$X.:${ ] ",
" <$[$}$|$1$2$3$4$5$6$7$8$9$0$a$b$c$d$e$f$g$h$i$j$k$l$m$. n$o$U p${ ] ",
" q$r$s$t$u$v$w$x$y$z$A$B$C$D$E$F$a+G$b.H$I$J$K$L$M$N$O$P$Q$R$S$T${ ] ",
" U$V$W$X$Y$Z$`$ %.%+%@%#%$%C$A${ D.%%&%*%=%-%;%;%>%,%'%)%!%~%{%{ ]% ",
" ^%/%(%_%:%<%[%}%|%1%2%3%4%5%6%7%E.8%9%0%a%b%b%c%d%F+e%f%g%h%^#{ i% ",
" j%k%l%m%n%Z.o%p%q%r%s%t%u%v%w%x%y#y%z%A%B%C%D%E%F%G%H%I%J%K%L%{ i% ",
" M%N%O%P%N%k%Q%R%Q%S%T%U%V%W%X%s$Y%Z%`% &#..&+&@&#&$&%&&&*&=&-&{ ",
" ;&>&,&n%'&'&k%'&)&'&W%W%k%Q%R%Q%*&W%R%R%W%W%S%!&Q%~&{&W%R%W%]&]% ",
" ^&: /&(&_&'&:&<&'&[&k%k%k%W%R%W%R%R%V%k%R%k%R%k%}&|&1&2&Q%3&]% ",
" 4&5&6&T$7&8&9&0&N%k%k%R%k%N%k%R%R%Q%R%k%a&b&c&d&Z%p%]% ",
" e&f&g&h&i&j&k&l&m&n&o&p&'#q&r&s&7&t&u&v&w&x&y&z&A&[$0& ",
" i&B&B&B&C&C&v&D&E&d#t&F&G&<.<.H&I&J&K&L&J&j&M&H&N&O&}@ ",
" P&Q&R&S&T&C&B&B&C&U&B&V&W&T&o%X&Y&&.p%Z&L%`& *U# ",
" .*W++*@*#*$*%*&***Y&=*-*B&;*;*C&]% ",
" >*>*>*>*>*>*>*>*>* ,*'*<$)*!*~*{*]*^* ",
" >*/*(*(*(*(*(*(*(*_*>* >*>* ",
" >*>*:*:*<*>*>*_*(*>*>*[*}*>* ",
" >*>*:*:*<*>*<*|*(*>*/*1*}*>* >*>*>*>* >*>*>*>*>*>*>*>*>*>*>*>*>*>*>*>*>*>* ",
" >*>*:*:*<*>*}*<*2*/*3*:*4*(*>*>*_*(*(*2*>*/*(*(*/*_*(*/*>*(*(*(*(*(*(*>*/*(*_*>* ",
" >*>*:*:*[*[*:*<*>*>*(*:*}*>*>*}*:*>*}*:*2*>*(*:*4*(*:*}*>*<*:*:*>*}*:*3*/*(*:*}*>* ",
" >*>*:*:*5*5*:*<*>*>*(*:*}*>*|*(*:*>*}*:*(*>*(*:*}*>*}*<*>*<*:*:*>*}*:*(*>*(*:*}*>* ",
" >*>*:*:*<*6*5*<*>*>*(*:*}*>*<*:*:*(*4*:*(*>*(*:*}*>*>*>*>*<*:*:*>*}*:*(*>*(*:*}*>* ",
" >*>*:*:*<*>*/*2*6*|*(*:*}*>*<*:*:*>*>*>*>*>*(*:*}*>* >*<*:*:*>*}*:*(*>*(*:*}*>* ",
" >*>*:*:*<*>*>*>*<*}*(*:*}*>*<*:*:*/*>*>*/*>*(*:*}*>* >*<*:*:*>*}*:*(*>*(*:*}*>* ",
" >*>*:*:*<*>*>*_*5*|*(*:*}*_*6*5*:*3*(*(*2*>*(*:*}*>* >*<*:*:*>*}*:*(*>*(*:*}*>* ",
" >*/*(*(*(*(*(*(*(*_*>*>*(*(*2*>*>*_*(*(*2*>*/*(*(*(*2*>* >*(*(*(*(*(*(*(*(*(*(*(*2*>* ",
" >*>*>*>*>*>*>*>*>* >*>*>* >*>*>*>* >*>*>*>*>* >*>*>*>*>*>*>*>*>*>*>*>* ",
" "};

View File

@ -25,7 +25,7 @@
# define _MENUS_H
# include <X11/Xfuncproto.h>
# include <Imlib.h>
# include <Imlib2.h>
# include "events.h"
# include "pixmap.h"

View File

@ -499,11 +499,6 @@ version(void)
#else
printf(" -PIXMAP_OFFSET");
#endif
#ifdef IMLIB_TRANS
printf(" +IMLIB_TRANS");
#else
printf(" -IMLIB_TRANS");
#endif
#ifdef BACKGROUND_CYCLING_SUPPORT
printf(" +BACKGROUND_CYCLING_SUPPORT");
#else
@ -2742,7 +2737,7 @@ parse_image(char *buff, void *state)
n = NumWords(mods);
if (!BEG_STRCASECMP(color, "image ")) {
RESET_AND_ASSIGN(iml->mod, (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier)));
RESET_AND_ASSIGN(iml->mod, (colormod_t *) MALLOC(sizeof(colormod_t)));
iml->mod->contrast = iml->mod->gamma = 0xff;
iml->mod->brightness = (int) strtol(mods, (char **) NULL, 0);
if (n > 1) {
@ -2752,7 +2747,7 @@ parse_image(char *buff, void *state)
iml->mod->gamma = (int) strtol(PWord(3, mods), (char **) NULL, 0);
}
} else if (!BEG_STRCASECMP(color, "red ")) {
RESET_AND_ASSIGN(iml->rmod, (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier)));
RESET_AND_ASSIGN(iml->rmod, (colormod_t *) MALLOC(sizeof(colormod_t)));
iml->rmod->contrast = iml->rmod->gamma = 0xff;
iml->rmod->brightness = (int) strtol(mods, (char **) NULL, 0);
if (n > 1) {
@ -2762,7 +2757,7 @@ parse_image(char *buff, void *state)
iml->rmod->gamma = (int) strtol(PWord(3, mods), (char **) NULL, 0);
}
} else if (!BEG_STRCASECMP(color, "green ")) {
RESET_AND_ASSIGN(iml->gmod, (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier)));
RESET_AND_ASSIGN(iml->gmod, (colormod_t *) MALLOC(sizeof(colormod_t)));
iml->gmod->contrast = iml->gmod->gamma = 0xff;
iml->gmod->brightness = (int) strtol(mods, (char **) NULL, 0);
if (n > 1) {
@ -2772,7 +2767,7 @@ parse_image(char *buff, void *state)
iml->gmod->gamma = (int) strtol(PWord(3, mods), (char **) NULL, 0);
}
} else if (!BEG_STRCASECMP(color, "blue ")) {
RESET_AND_ASSIGN(iml->bmod, (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier)));
RESET_AND_ASSIGN(iml->bmod, (colormod_t *) MALLOC(sizeof(colormod_t)));
iml->bmod->contrast = iml->bmod->gamma = 0xff;
iml->bmod->brightness = (int) strtol(mods, (char **) NULL, 0);
if (n > 1) {
@ -2795,7 +2790,7 @@ parse_image(char *buff, void *state)
print_error("Parse error in file %s, line %lu: Invalid parameter list for attribute \"border\"", file_peek_path(), file_peek_line());
return NULL;
}
RESET_AND_ASSIGN(images[idx].current->iml->border, (ImlibBorder *) MALLOC(sizeof(ImlibBorder)));
RESET_AND_ASSIGN(images[idx].current->iml->border, (Imlib_Border *) MALLOC(sizeof(Imlib_Border)));
images[idx].current->iml->border->left = (unsigned short) strtoul(PWord(2, buff), (char **) NULL, 0);
images[idx].current->iml->border->right = (unsigned short) strtoul(PWord(3, buff), (char **) NULL, 0);
@ -2805,7 +2800,7 @@ parse_image(char *buff, void *state)
if ((images[idx].current->iml->border->left == 0) && (images[idx].current->iml->border->right == 0)
&& (images[idx].current->iml->border->top == 0) && (images[idx].current->iml->border->bottom == 0)) {
FREE(images[idx].current->iml->border);
images[idx].current->iml->border = (ImlibBorder *) NULL; /* No sense in wasting CPU time and memory if there are no borders */
images[idx].current->iml->border = (Imlib_Border *) NULL; /* No sense in wasting CPU time and memory if there are no borders */
}
} else if (!BEG_STRCASECMP(buff, "bevel ")) {
if (idx < 0) {
@ -2825,7 +2820,7 @@ parse_image(char *buff, void *state)
FREE(images[idx].current->iml->bevel);
}
images[idx].current->iml->bevel = (bevel_t *) MALLOC(sizeof(bevel_t));
images[idx].current->iml->bevel->edges = (ImlibBorder *) MALLOC(sizeof(ImlibBorder));
images[idx].current->iml->bevel->edges = (Imlib_Border *) MALLOC(sizeof(Imlib_Border));
if (!BEG_STRCASECMP(PWord(2, buff), "down")) {
images[idx].current->iml->bevel->up = 0;
@ -2840,7 +2835,7 @@ parse_image(char *buff, void *state)
if ((images[idx].current->iml->bevel->edges->left == 0) && (images[idx].current->iml->bevel->edges->right == 0)
&& (images[idx].current->iml->bevel->edges->top == 0) && (images[idx].current->iml->bevel->edges->bottom == 0)) {
FREE(images[idx].current->iml->bevel->edges);
images[idx].current->iml->bevel->edges = (ImlibBorder *) NULL;
images[idx].current->iml->bevel->edges = (Imlib_Border *) NULL;
FREE(images[idx].current->iml->bevel);
images[idx].current->iml->bevel = (bevel_t *) NULL;
}
@ -2857,7 +2852,7 @@ parse_image(char *buff, void *state)
print_error("Parse error in file %s, line %lu: Invalid parameter list for attribute \"padding\"", file_peek_path(), file_peek_line());
return NULL;
}
RESET_AND_ASSIGN(images[idx].current->iml->pad, (ImlibBorder *) MALLOC(sizeof(ImlibBorder)));
RESET_AND_ASSIGN(images[idx].current->iml->pad, (Imlib_Border *) MALLOC(sizeof(Imlib_Border)));
images[idx].current->iml->pad->left = (unsigned short) strtoul(PWord(2, buff), (char **) NULL, 0);
images[idx].current->iml->pad->right = (unsigned short) strtoul(PWord(3, buff), (char **) NULL, 0);
@ -2867,7 +2862,7 @@ parse_image(char *buff, void *state)
if ((images[idx].current->iml->pad->left == 0) && (images[idx].current->iml->pad->right == 0)
&& (images[idx].current->iml->pad->top == 0) && (images[idx].current->iml->pad->bottom == 0)) {
FREE(images[idx].current->iml->pad);
images[idx].current->iml->pad = (ImlibBorder *) NULL;
images[idx].current->iml->pad = (Imlib_Border *) NULL;
}
} else {
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid "
@ -3850,7 +3845,7 @@ post_parse(void)
unsigned char n = NumWords(rs_cmod_image);
imlib_t *iml = images[image_bg].norm->iml;
RESET_AND_ASSIGN(iml->mod, (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier)));
RESET_AND_ASSIGN(iml->mod, (colormod_t *) MALLOC(sizeof(colormod_t)));
iml->mod->contrast = iml->mod->gamma = 0xff;
iml->mod->brightness = (int) strtol(rs_cmod_image, (char **) NULL, 0);
if (n > 1) {
@ -3865,7 +3860,7 @@ post_parse(void)
unsigned char n = NumWords(rs_cmod_red);
imlib_t *iml = images[image_bg].norm->iml;
RESET_AND_ASSIGN(iml->rmod, (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier)));
RESET_AND_ASSIGN(iml->rmod, (colormod_t *) MALLOC(sizeof(colormod_t)));
iml->rmod->contrast = iml->rmod->gamma = 0xff;
iml->rmod->brightness = (int) strtol(rs_cmod_red, (char **) NULL, 0);
if (n > 1) {
@ -3880,7 +3875,7 @@ post_parse(void)
unsigned char n = NumWords(rs_cmod_green);
imlib_t *iml = images[image_bg].norm->iml;
RESET_AND_ASSIGN(iml->gmod, (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier)));
RESET_AND_ASSIGN(iml->gmod, (colormod_t *) MALLOC(sizeof(colormod_t)));
iml->gmod->contrast = iml->gmod->gamma = 0xff;
iml->gmod->brightness = (int) strtol(rs_cmod_green, (char **) NULL, 0);
if (n > 1) {
@ -3895,7 +3890,7 @@ post_parse(void)
unsigned char n = NumWords(rs_cmod_blue);
imlib_t *iml = images[image_bg].norm->iml;
RESET_AND_ASSIGN(iml->bmod, (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier)));
RESET_AND_ASSIGN(iml->bmod, (colormod_t *) MALLOC(sizeof(colormod_t)));
iml->bmod->contrast = iml->bmod->gamma = 0xff;
iml->bmod->brightness = (int) strtol(rs_cmod_blue, (char **) NULL, 0);
if (n > 1) {
@ -4208,12 +4203,15 @@ save_config(char *path, unsigned char save_theme)
/* Now save each state. */
simg = images[i].norm;
if (simg->iml->im) {
imlib_context_set_image(simg->iml->im);
}
fprintf(fp, " state normal\n");
if (simg->fg || simg->bg) {
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
}
if (simg->iml->im) {
fprintf(fp, " file %s\n", NONULL(simg->iml->im->filename));
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
}
fprintf(fp, " geom %hdx%hd+%hd+%hd", simg->pmap->w, simg->pmap->h, simg->pmap->x, simg->pmap->y);
if (simg->pmap->op & OP_TILE) {
@ -4255,12 +4253,15 @@ save_config(char *path, unsigned char save_theme)
/* Selected state */
if (images[i].selected != images[i].norm) {
simg = images[i].selected;
if (simg->iml->im) {
imlib_context_set_image(simg->iml->im);
}
fprintf(fp, " state selected\n");
if (simg->fg || simg->bg) {
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
}
if (simg->iml->im) {
fprintf(fp, " file %s\n", NONULL(simg->iml->im->filename));
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
}
fprintf(fp, " geom %hdx%hd+%hd+%hd", simg->pmap->w, simg->pmap->h, simg->pmap->x, simg->pmap->y);
if (simg->pmap->op & OP_TILE) {
@ -4303,12 +4304,15 @@ save_config(char *path, unsigned char save_theme)
/* Clicked state */
if (images[i].clicked != images[i].norm) {
simg = images[i].clicked;
if (simg->iml->im) {
imlib_context_set_image(simg->iml->im);
}
fprintf(fp, " state clicked\n");
if (simg->fg || simg->bg) {
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
}
if (simg->iml->im) {
fprintf(fp, " file %s\n", NONULL(simg->iml->im->filename));
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
}
fprintf(fp, " geom %hdx%hd+%hd+%hd", simg->pmap->w, simg->pmap->h, simg->pmap->x, simg->pmap->y);
if (simg->pmap->op & OP_TILE) {
@ -4351,12 +4355,15 @@ save_config(char *path, unsigned char save_theme)
/* Disabled state */
if (images[i].disabled != images[i].norm) {
simg = images[i].disabled;
if (simg->iml->im) {
imlib_context_set_image(simg->iml->im);
}
fprintf(fp, " state disabled\n");
if (simg->fg || simg->bg) {
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
}
if (simg->iml->im) {
fprintf(fp, " file %s\n", NONULL(simg->iml->im->filename));
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
}
fprintf(fp, " geom %hdx%hd+%hd+%hd", simg->pmap->w, simg->pmap->h, simg->pmap->x, simg->pmap->y);
if (simg->pmap->op & OP_TILE) {

View File

@ -31,13 +31,17 @@ static const char cvs_ident[] = "$Id$";
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
#include <Imlib.h>
#ifdef HAVE_X_SHAPE_EXT
# include <X11/X.h>
# include <X11/Xlib.h>
# include <X11/Xutil.h>
# include <X11/extensions/shape.h>
#endif
#include "../libmej/debug.h"
#include "../libmej/mem.h"
#include "../libmej/strings.h"
#include "e.h"
#include "icon.h"
#include "startup.h"
#include "menus.h"
#include "options.h"
@ -48,14 +52,13 @@ static const char cvs_ident[] = "$Id$";
#include "windows.h"
#ifdef PIXMAP_SUPPORT
static ImlibBorder bord_none = { 0, 0, 0, 0 };
static ImlibColorModifier cmod_none = { 256, 256, 256 };
static Imlib_Border bord_none = { 0, 0, 0, 0 };
static colormod_t cmod_none = { 256, 256, 256 };
Pixmap desktop_pixmap = None, viewport_pixmap = None;
Pixmap buffer_pixmap = None;
Window desktop_window = None;
unsigned char desktop_pixmap_is_mine = 0;
ImlibData *imlib_id = NULL;
image_t images[image_max] =
{
{None, 0, 0, NULL, NULL, NULL, NULL, NULL},
@ -346,15 +349,13 @@ reset_simage(simage_t * simg, unsigned long mask)
D_PIXMAP(("reset_simage(%8p, 0x%08x)\n", simg, mask));
if ((mask & RESET_IMLIB_IM) && simg->iml->im) {
Imlib_destroy_image(imlib_id, simg->iml->im);
imlib_context_set_image(simg->iml->im);
imlib_free_image_and_decache();
simg->iml->im = NULL;
}
if ((mask & RESET_PMAP_PIXMAP) && simg->pmap->pixmap != None) {
Imlib_free_pixmap(imlib_id, simg->pmap->pixmap);
if (((mask & RESET_PMAP_PIXMAP) && simg->pmap->pixmap != None) || ((mask & RESET_PMAP_MASK) && simg->pmap->mask != None)) {
imlib_free_pixmap_and_mask(simg->pmap->pixmap);
simg->pmap->pixmap = None;
}
if ((mask & RESET_PMAP_MASK) && simg->pmap->mask != None) {
Imlib_free_pixmap(imlib_id, simg->pmap->mask);
simg->pmap->mask = None;
}
if ((mask & RESET_IMLIB_BORDER) && simg->iml->border) {
@ -495,7 +496,7 @@ create_trans_pixmap(simage_t *simg, unsigned char which, Drawable d, int x, int
if (simg->iml->bevel != NULL) {
D_PIXMAP(("Beveling pixmap 0x%08x with edges %d, %d, %d, %d\n", p, simg->iml->bevel->edges->left, simg->iml->bevel->edges->top,
simg->iml->bevel->edges->right, simg->iml->bevel->edges->bottom));
Imlib_bevel_pixmap(imlib_id, p, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);
FIXME_NOP(Imlib_bevel_pixmap(imlib_id, p, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);) /* Need to write this */
}
}
XFreeGC(Xdisplay, gc);
@ -509,7 +510,7 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short
Window dummy;
unsigned int pw, ph, pb, pd;
int px, py;
Pixmap p = None;
Pixmap p = None, mask = None;
GC gc;
Screen *scr;
@ -528,13 +529,20 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short
if (viewport_pixmap == None) {
imlib_t *tmp_iml = images[image_bg].current->iml;
xsize = tmp_iml->im->rgb_width;
ysize = tmp_iml->im->rgb_height;
imlib_context_set_image(tmp_iml->im);
imlib_context_set_drawable(d);
imlib_image_set_has_alpha(0);
imlib_context_set_anti_alias(1);
imlib_context_set_dither(1);
imlib_context_set_blend(0);
xsize = imlib_image_get_width();
ysize = imlib_image_get_height();
if (tmp_iml->border) {
Imlib_set_image_border(imlib_id, tmp_iml->im, tmp_iml->border);
imlib_image_set_border(tmp_iml->border);
} else {
Imlib_set_image_border(imlib_id, tmp_iml->im, &bord_none);
imlib_image_set_border(&bord_none);
}
#ifdef FIXME_BLOCK
if (tmp_iml->mod) {
Imlib_set_image_modifier(imlib_id, tmp_iml->im, tmp_iml->mod);
} else {
@ -555,14 +563,14 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short
} else {
Imlib_set_image_blue_modifier(imlib_id, tmp_iml->im, &cmod_none);
}
#endif
if ((images[image_bg].current->pmap->w > 0) || (images[image_bg].current->pmap->op & OP_SCALE)) {
D_PIXMAP(("Scaling image to %dx%d\n", scr->width, scr->height));
Imlib_render(imlib_id, tmp_iml->im, scr->width, scr->height);
imlib_render_pixmaps_for_whole_image_at_size(&viewport_pixmap, &mask, 0, scr->width, scr->height);
} else {
D_PIXMAP(("Tiling image at %dx%d\n", xsize, ysize));
Imlib_render(imlib_id, tmp_iml->im, xsize, ysize);
imlib_render_pixmaps_for_whole_image(&viewport_pixmap, &mask, 0);
}
viewport_pixmap = Imlib_copy_image(imlib_id, tmp_iml->im);
D_PIXMAP(("Created viewport_pixmap == 0x%08x\n", viewport_pixmap));
} else {
XGetGeometry(Xdisplay, viewport_pixmap, &dummy, &px, &py, &pw, &ph, &pb, &pd);
@ -572,7 +580,7 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short
if (simg->pmap->pixmap != None) {
XGetGeometry(Xdisplay, simg->pmap->pixmap, &dummy, &px, &py, &pw, &ph, &pb, &pd);
if (pw != width || ph != height) {
Imlib_free_pixmap(imlib_id, simg->pmap->pixmap);
imlib_free_pixmap_and_mask(simg->pmap->pixmap);
simg->pmap->pixmap = None;
} else {
p = simg->pmap->pixmap;
@ -600,6 +608,8 @@ create_viewport_pixmap(simage_t *simg, Drawable d, int x, int y, unsigned short
void
paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x, unsigned short y, unsigned short w, unsigned short h)
{
Pixmap pmap = None, mask = None;
GC gc;
ASSERT(simg != NULL);
REQUIRE(d != None);
@ -610,7 +620,6 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x,
if (image_mode_is(which, MODE_AUTO) && image_mode_is(which, ALLOW_AUTO)) {
char buff[255], *reply;
const char *iclass, *state;
Pixmap pmap, mask;
check_image_ipc(0);
if (image_mode_is(which, MODE_AUTO)) {
@ -632,10 +641,6 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x,
image_mode_fallback(which);
FREE(reply);
} else {
GC gc;
XGCValues gcvalues;
gc = XCreateGC(Xdisplay, d, 0, &gcvalues);
pmap = (Pixmap) strtoul(reply, (char **) NULL, 0);
mask = (Pixmap) strtoul(PWord(2, reply), (char **) NULL, 0);
FREE(reply);
@ -644,6 +649,7 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x,
if (mask) {
shaped_window_apply_mask(pmap, mask);
}
gc = XCreateGC(Xdisplay, d, 0, NULL);
XSetClipMask(Xdisplay, gc, mask);
XSetClipOrigin(Xdisplay, gc, x, y);
XCopyArea(Xdisplay, pmap, d, gc, 0, 0, w, h, x, y);
@ -661,35 +667,41 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x,
}
} else if (image_mode_is(which, MODE_TRANS) && image_mode_is(which, ALLOW_TRANS)) {
Pixmap p;
GC gc;
gc = XCreateGC(Xdisplay, d, 0, NULL);
p = create_trans_pixmap(simg, which, d, x, y, w, h);
if (simg->iml->bevel != NULL) {
Imlib_bevel_pixmap(imlib_id, p, w, h, simg->iml->bevel->edges, simg->iml->bevel->up);
FIXME_NOP(Imlib_bevel_pixmap(imlib_id, p, w, h, simg->iml->bevel->edges, simg->iml->bevel->up);)
}
XCopyArea(Xdisplay, p, d, gc, 0, 0, w, h, x, y);
XFreePixmap(Xdisplay, p);
XFreeGC(Xdisplay, gc);
} else if (image_mode_is(which, MODE_VIEWPORT) && image_mode_is(which, ALLOW_VIEWPORT)) {
Pixmap p;
GC gc;
gc = XCreateGC(Xdisplay, d, 0, NULL);
p = create_viewport_pixmap(simg, d, x, y, w, h);
if (simg->iml->bevel != NULL) {
Imlib_bevel_pixmap(imlib_id, p, w, h, simg->iml->bevel->edges, simg->iml->bevel->up);
FIXME_NOP(Imlib_bevel_pixmap(imlib_id, p, w, h, simg->iml->bevel->edges, simg->iml->bevel->up);)
}
XCopyArea(Xdisplay, p, d, gc, 0, 0, w, h, x, y);
XFreePixmap(Xdisplay, p);
XFreeGC(Xdisplay, gc);
}
}
if ((which == image_max) || (image_mode_is(which, MODE_IMAGE) && image_mode_is(which, ALLOW_IMAGE))) {
imlib_context_set_image(simg->iml->im);
imlib_context_set_drawable(d);
imlib_context_set_anti_alias(1);
imlib_context_set_dither(1);
imlib_context_set_blend(0);
if (simg->iml->border) {
Imlib_set_image_border(imlib_id, simg->iml->im, simg->iml->border);
imlib_image_set_border(simg->iml->border);
} else {
Imlib_set_image_border(imlib_id, simg->iml->im, &bord_none);
imlib_image_set_border(&bord_none);
}
#ifdef FIXME_BLOCK
if (simg->iml->mod) {
Imlib_set_image_modifier(imlib_id, simg->iml->im, simg->iml->mod);
} else {
@ -710,7 +722,21 @@ paste_simage(simage_t *simg, unsigned char which, Drawable d, unsigned short x,
} else {
Imlib_set_image_blue_modifier(imlib_id, simg->iml->im, &cmod_none);
}
Imlib_paste_image(imlib_id, simg->iml->im, (Window) d, x, y, w, h);
#endif
if (w == imlib_image_get_width() && h == imlib_image_get_height()) {
imlib_render_pixmaps_for_whole_image(&pmap, &mask, 0);
} else {
imlib_render_pixmaps_for_whole_image_at_size(&pmap, &mask, 0, w, h);
}
ASSERT(pmap != None);
gc = XCreateGC(Xdisplay, d, 0, NULL);
if (mask) {
XSetClipMask(Xdisplay, gc, mask);
XSetClipOrigin(Xdisplay, gc, x, y);
}
XCopyArea(Xdisplay, pmap, d, gc, 0, 0, w, h, x, y);
imlib_free_pixmap_and_mask(pmap);
XFreeGC(Xdisplay, gc);
}
}
@ -937,8 +963,13 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
int x = simg->pmap->x;
int y = simg->pmap->y;
xsize = simg->iml->im->rgb_width;
ysize = simg->iml->im->rgb_height;
imlib_context_set_image(simg->iml->im);
imlib_context_set_drawable(win);
imlib_context_set_anti_alias(1);
imlib_context_set_dither(1);
imlib_context_set_blend(0);
xsize = imlib_image_get_width();
ysize = imlib_image_get_height();
D_PIXMAP(("w == %d, h == %d, x == %d, y == %d, xsize == %d, ysize == %d\n", w, h, x, y, xsize, ysize));
if ((simg->pmap->op & OP_PROPSCALE)) {
@ -976,93 +1007,91 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
ypos = (short) ((height - yscaled) * ((float) y / 100.0));
D_PIXMAP(("Calculated scaled size as %hux%hu with origin at (%hd, %hd)\n", xscaled, yscaled, xpos, ypos));
if (simg->iml->last_w != xscaled || simg->iml->last_h != yscaled || 1) {
simg->iml->last_w = xscaled;
simg->iml->last_h = yscaled;
if (simg->iml->border) {
D_PIXMAP(("Setting image border: { left [%d], right [%d], top [%d], bottom [%d] }\n",
simg->iml->border->left, simg->iml->border->right, simg->iml->border->top, simg->iml->border->bottom));
Imlib_set_image_border(imlib_id, simg->iml->im, simg->iml->border);
} else {
Imlib_set_image_border(imlib_id, simg->iml->im, &bord_none);
}
if (simg->iml->mod) {
D_PIXMAP(("Setting image modifier: { gamma [0x%08x], brightness [0x%08x], contrast [0x%08x] }\n",
simg->iml->mod->gamma, simg->iml->mod->brightness, simg->iml->mod->contrast));
Imlib_set_image_modifier(imlib_id, simg->iml->im, simg->iml->mod);
} else {
Imlib_set_image_modifier(imlib_id, simg->iml->im, &cmod_none);
}
if (simg->iml->rmod) {
D_PIXMAP(("Setting image red modifier: { gamma [0x%08x], brightness [0x%08x], contrast [0x%08x] }\n",
simg->iml->rmod->gamma, simg->iml->rmod->brightness, simg->iml->rmod->contrast));
Imlib_set_image_red_modifier(imlib_id, simg->iml->im, simg->iml->rmod);
} else {
Imlib_set_image_red_modifier(imlib_id, simg->iml->im, &cmod_none);
}
if (simg->iml->gmod) {
D_PIXMAP(("Setting image green modifier: { gamma [0x%08x], brightness [0x%08x], contrast [0x%08x] }\n",
simg->iml->gmod->gamma, simg->iml->gmod->brightness, simg->iml->gmod->contrast));
Imlib_set_image_green_modifier(imlib_id, simg->iml->im, simg->iml->gmod);
} else {
Imlib_set_image_green_modifier(imlib_id, simg->iml->im, &cmod_none);
}
if (simg->iml->bmod) {
D_PIXMAP(("Setting image blue modifier: { gamma [0x%08x], brightness [0x%08x], contrast [0x%08x] }\n",
simg->iml->bmod->gamma, simg->iml->bmod->brightness, simg->iml->bmod->contrast));
Imlib_set_image_blue_modifier(imlib_id, simg->iml->im, simg->iml->bmod);
} else {
Imlib_set_image_blue_modifier(imlib_id, simg->iml->im, &cmod_none);
}
D_PIXMAP(("Rendering image simg->iml->im [%8p] to %hdx%hd pixmap\n", simg->iml->im, xscaled, yscaled));
Imlib_render(imlib_id, simg->iml->im, xscaled, yscaled);
rendered = 1;
if (simg->iml->border) {
D_PIXMAP(("Setting image border: { left [%d], right [%d], top [%d], bottom [%d] }\n",
simg->iml->border->left, simg->iml->border->right, simg->iml->border->top, simg->iml->border->bottom));
imlib_image_set_border(simg->iml->border);
} else {
imlib_image_set_border(&bord_none);
}
simg->pmap->pixmap = Imlib_copy_image(imlib_id, simg->iml->im);
simg->pmap->mask = Imlib_copy_mask(imlib_id, simg->iml->im);
#ifdef FIXME_BLOCK
if (simg->iml->mod) {
D_PIXMAP(("Setting image modifier: { gamma [0x%08x], brightness [0x%08x], contrast [0x%08x] }\n",
simg->iml->mod->gamma, simg->iml->mod->brightness, simg->iml->mod->contrast));
Imlib_set_image_modifier(imlib_id, simg->iml->im, simg->iml->mod);
} else {
Imlib_set_image_modifier(imlib_id, simg->iml->im, &cmod_none);
}
if (simg->iml->rmod) {
D_PIXMAP(("Setting image red modifier: { gamma [0x%08x], brightness [0x%08x], contrast [0x%08x] }\n",
simg->iml->rmod->gamma, simg->iml->rmod->brightness, simg->iml->rmod->contrast));
Imlib_set_image_red_modifier(imlib_id, simg->iml->im, simg->iml->rmod);
} else {
Imlib_set_image_red_modifier(imlib_id, simg->iml->im, &cmod_none);
}
if (simg->iml->gmod) {
D_PIXMAP(("Setting image green modifier: { gamma [0x%08x], brightness [0x%08x], contrast [0x%08x] }\n",
simg->iml->gmod->gamma, simg->iml->gmod->brightness, simg->iml->gmod->contrast));
Imlib_set_image_green_modifier(imlib_id, simg->iml->im, simg->iml->gmod);
} else {
Imlib_set_image_green_modifier(imlib_id, simg->iml->im, &cmod_none);
}
if (simg->iml->bmod) {
D_PIXMAP(("Setting image blue modifier: { gamma [0x%08x], brightness [0x%08x], contrast [0x%08x] }\n",
simg->iml->bmod->gamma, simg->iml->bmod->brightness, simg->iml->bmod->contrast));
Imlib_set_image_blue_modifier(imlib_id, simg->iml->im, simg->iml->bmod);
} else {
Imlib_set_image_blue_modifier(imlib_id, simg->iml->im, &cmod_none);
}
#endif
D_PIXMAP(("Rendering image simg->iml->im [%8p] to %hdx%hd pixmap\n", simg->iml->im, xscaled, yscaled));
imlib_render_pixmaps_for_whole_image_at_size(&simg->pmap->pixmap, &simg->pmap->mask, 0, xscaled, yscaled);
rendered = 1;
if (simg->pmap->mask != None) {
shaped_window_apply_mask(win, simg->pmap->mask);
}
if (simg->pmap->pixmap != None) {
if (pixmap != None) {
imlib_free_pixmap_and_mask(pixmap);
}
if (xscaled != width || yscaled != height || xpos != 0 || ypos != 0) {
unsigned char single;
/* This tells us if we have a single, non-tiled image which does not entirely fill the window */
single = ((xscaled < width || yscaled < height) && !(simg->pmap->op & OP_TILE)) ? 1 : 0;
pixmap = simg->pmap->pixmap;
simg->pmap->pixmap = XCreatePixmap(Xdisplay, win, width, height, Xdepth);
if (single) {
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
}
XSetTile(Xdisplay, gc, pixmap);
XSetTSOrigin(Xdisplay, gc, xpos, ypos);
XSetFillStyle(Xdisplay, gc, FillTiled);
if (single) {
XCopyArea(Xdisplay, pixmap, simg->pmap->pixmap, gc, 0, 0, xscaled, yscaled, xpos, ypos);
} else {
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
}
imlib_free_pixmap_and_mask(pixmap);
}
if (simg->iml->bevel != NULL) {
FIXME_NOP(Imlib_bevel_pixmap(imlib_id, simg->pmap->pixmap, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);)
}
D_PIXMAP(("Setting background of window 0x%08x to 0x%08x\n", win, simg->pmap->pixmap));
if ((which == image_bg) && (Options & Opt_double_buffer)) {
copy_buffer_pixmap(MODE_VIEWPORT, (unsigned long) simg->pmap->pixmap, width, height);
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
} else {
/* FIXME: For efficiency, just fill the window with the pixmap
and handle exposes by copying from simg->pmap->pixmap. */
XSetWindowBackgroundPixmap(Xdisplay, win, simg->pmap->pixmap);
}
}
} else {
image_set_mode(which, MODE_SOLID);
reset_simage(simg, RESET_ALL_SIMG);
}
if (simg->pmap->pixmap != None) {
if (pixmap != None) {
Imlib_free_pixmap(imlib_id, pixmap);
}
if (xscaled != width || yscaled != height || xpos != 0 || ypos != 0) {
unsigned char single;
single = ((xscaled < width || yscaled < height) && !(simg->pmap->op & OP_TILE)) ? 1 : 0;
pixmap = simg->pmap->pixmap;
simg->pmap->pixmap = XCreatePixmap(Xdisplay, win, width, height, Xdepth);
if (single)
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
XSetTile(Xdisplay, gc, pixmap);
XSetTSOrigin(Xdisplay, gc, xpos, ypos);
XSetFillStyle(Xdisplay, gc, FillTiled);
if (single) {
XCopyArea(Xdisplay, pixmap, simg->pmap->pixmap, gc, 0, 0, xscaled, yscaled, xpos, ypos);
} else {
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
}
Imlib_free_pixmap(imlib_id, pixmap);
}
if (simg->iml->bevel != NULL) {
Imlib_bevel_pixmap(imlib_id, simg->pmap->pixmap, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);
}
D_PIXMAP(("Setting background of window 0x%08x to 0x%08x\n", win, simg->pmap->pixmap));
if ((which == image_bg) && (Options & Opt_double_buffer)) {
copy_buffer_pixmap(MODE_VIEWPORT, (unsigned long) simg->pmap->pixmap, width, height);
XSetWindowBackgroundPixmap(Xdisplay, win, buffer_pixmap);
} else {
XSetWindowBackgroundPixmap(Xdisplay, win, simg->pmap->pixmap);
}
}
}
/* Fall back to solid mode if all else fails. */
@ -1079,8 +1108,10 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
XSetForeground(Xdisplay, gc, ((which == image_bg) ? (PixColors[bgColor]) : (simg->bg)));
XFillRectangle(Xdisplay, simg->pmap->pixmap, gc, 0, 0, width, height);
if (simg->iml->bevel != NULL) {
Imlib_bevel_pixmap(imlib_id, simg->pmap->pixmap, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);
FIXME_NOP(Imlib_bevel_pixmap(imlib_id, simg->pmap->pixmap, width, height, simg->iml->bevel->edges, simg->iml->bevel->up);)
}
/* FIXME: For efficiency, just fill the window with the pixmap
and handle exposes by copying from simg->pmap->pixmap. */
XSetWindowBackgroundPixmap(Xdisplay, win, simg->pmap->pixmap);
} else {
XSetWindowBackground(Xdisplay, win, ((which == image_bg) ? (PixColors[bgColor]) : (simg->bg)));
@ -1202,7 +1233,7 @@ unsigned char
load_image(const char *file, simage_t *simg)
{
const char *f;
ImlibImage *im;
Imlib_Image *im;
char *geom;
ASSERT_RVAL(file != NULL, 0);
@ -1223,7 +1254,7 @@ load_image(const char *file, simage_t *simg)
f = search_path(getenv(PATH_ENV), file, PIXMAP_EXT);
}
if (f != NULL) {
im = Imlib_load_image(imlib_id, (char *) f);
im = imlib_load_image(f);
if (im == NULL) {
print_error("Unable to load image file \"%s\"", file);
return 0;
@ -1260,9 +1291,11 @@ colormod_trans(Pixmap p, imlib_t *iml, GC gc, unsigned short w, unsigned short h
XImage *ximg;
register unsigned long v, i;
unsigned long x, y;
#if 0
int r, g, b;
#endif
unsigned short rm, gm, bm, shade;
ImlibColor ctab[256];
Imlib_Color ctab[256];
int real_depth = 0;
register int br, bg, bb;
register unsigned int mr, mg, mb;
@ -1305,10 +1338,9 @@ colormod_trans(Pixmap p, imlib_t *iml, GC gc, unsigned short w, unsigned short h
}
XQueryColors(Xdisplay, cmap, cols, 1 << Xdepth);
for (i = 0; i < (unsigned long) (1 << Xdepth); i++) {
ctab[i].r = cols[i].red >> 8;
ctab[i].g = cols[i].green >> 8;
ctab[i].b = cols[i].blue >> 8;
ctab[i].pixel = cols[i].pixel;
ctab[i].red = cols[i].red >> 8;
ctab[i].green = cols[i].green >> 8;
ctab[i].blue = cols[i].blue >> 8;
}
} else if (Xdepth == 16) {
@ -1329,6 +1361,7 @@ colormod_trans(Pixmap p, imlib_t *iml, GC gc, unsigned short w, unsigned short h
}
D_PIXMAP(("XGetImage(Xdisplay, 0x%08x, 0, 0, %d, %d, -1, ZPixmap) returned %8p.\n", p, w, h, ximg));
if (Xdepth <= 8) {
#ifdef FIXME_BLOCK
D_PIXMAP(("Rendering low-depth image, depth == %d\n", (int) Xdepth));
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
@ -1340,6 +1373,7 @@ colormod_trans(Pixmap p, imlib_t *iml, GC gc, unsigned short w, unsigned short h
XPutPixel(ximg, x, y, v);
}
}
#endif
} else {
D_PIXMAP(("Rendering high-depth image, depth == %d\n", real_depth));
/* Determine bitshift and bitmask values */
@ -1661,9 +1695,9 @@ shaped_window_apply_mask(Drawable d, Pixmap mask)
void
set_icon_pixmap(char *filename, XWMHints * pwm_hints)
{
#ifdef FIXME_BLOCK
const char *icon_path;
ImlibImage *temp_im;
Imlib_Image temp_im;
XWMHints *wm_hints;
if (pwm_hints) {
@ -1680,7 +1714,7 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
XIconSize *icon_sizes;
int count, i, w = 8, h = 8; /* At least 8x8 */
temp_im = Imlib_load_image(imlib_id, (char *) icon_path);
temp_im = imlib_load_image(icon_path);
/* If we're going to render the image anyway, might as well be nice and give it to the WM in a size it likes. */
if (XGetIconSizes(Xdisplay, Xroot, &icon_sizes, &count)) {
for (i = 0; i < count; i++) {
@ -1700,9 +1734,13 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
}
MIN_IT(w, 64);
MIN_IT(h, 64);
Imlib_render(imlib_id, temp_im, w, h);
wm_hints->icon_pixmap = Imlib_copy_image(imlib_id, temp_im);
wm_hints->icon_mask = Imlib_copy_mask(imlib_id, temp_im);
imlib_context_set_image(temp_im);
imlib_context_set_drawable(TermWin.parent);
imlib_image_set_has_alpha(0);
imlib_context_set_anti_alias(1);
imlib_context_set_dither(1);
imlib_context_set_blend(0);
imlib_render_pixmaps_for_whole_image_at_size(&wm_hints->icon_pixmap, &wm_hints->icon_mask, 0, w, h);
if (check_for_enlightenment()) {
wm_hints->flags |= IconPixmapHint | IconMaskHint;
} else {
@ -1711,7 +1749,7 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
XSetWindowBackgroundPixmap(Xdisplay, wm_hints->icon_window, wm_hints->icon_pixmap);
wm_hints->flags |= IconWindowHint;
}
Imlib_destroy_image(imlib_id, temp_im);
imlib_free_image_and_decache();
}
} else {
/* Use the default. It's 48x48, so if the WM doesn't like it, tough cookies. Pixmap -> ImlibImage -> Render -> Pixmap would be
@ -1734,32 +1772,6 @@ set_icon_pixmap(char *filename, XWMHints * pwm_hints)
XSetWMHints(Xdisplay, TermWin.parent, wm_hints);
XFree(wm_hints);
}
#endif
}
# ifdef USE_EFFECTS
int
fade_in(ImlibImage *img, int frames)
{
static int i = 0;
register int f = frames;
ImlibColorModifier mod;
double gamma, brightness, contrast;
Imlib_get_image_modifier(imlib_id, img, &mod);
if (i < f) {
i++;
gamma = (double) mod.gamma / i;
brightness = (double) mod.brightness / i;
contrast = (double) mod.contrast / i;
Imlib_set_image_modifier(imlib_id, img, &mod);
} else if (i == f) {
i = 0;
}
/* how many frames to go */
return (f - i);
}
# endif /* USE_EFFECTS */
#endif /* PIXMAP_SUPPORT */

View File

@ -25,7 +25,7 @@
# define _PIXMAP_H
#include <X11/Xatom.h>
#include <Imlib.h>
#include <Imlib2.h>
#include "misc.h"
@ -37,8 +37,9 @@
# define background_is_auto() (images[image_bg].mode & MODE_AUTO)
# define background_is_pixmap() (background_is_image() || background_is_trans() || background_is_viewport() || background_is_auto())
# define delete_simage(simg) do { \
Imlib_free_pixmap(imlib_id, (simg)->pmap->pixmap); \
Imlib_destroy_image(imlib_id, (simg)->iml->im); \
imlib_free_pixmap_and_mask((simg)->pmap->pixmap); \
imlib_context_set_image((simg)->iml->im); \
imlib_free_image_and_decache(); \
(simg)->pmap->pixmap = None; (simg)->iml->im = NULL; \
} while (0)
# define CONVERT_SHADE(s) (0xff - (((s) * 0xff) / 100))
@ -150,14 +151,18 @@ typedef struct {
Pixmap mask;
} pixmap_t;
typedef struct {
ImlibBorder *edges;
Imlib_Border *edges;
unsigned char up;
} bevel_t;
typedef struct cmod_struct {
unsigned short gamma, brightness, contrast;
} colormod_t;
typedef struct {
ImlibImage *im;
ImlibBorder *border, *pad;
Imlib_Image im;
Imlib_Border *border, *pad;
bevel_t *bevel;
ImlibColorModifier *mod, *rmod, *gmod, *bmod;
colormod_t *mod, *rmod, *gmod, *bmod;
Imlib_Color_Modifier imod, cmod;
short last_w, last_h;
} imlib_t;
typedef struct {
@ -174,7 +179,6 @@ typedef short renderop_t;
/************ Variables ************/
extern image_t images[image_max];
extern ImlibData *imlib_id;
extern Pixmap desktop_pixmap, viewport_pixmap, buffer_pixmap;
extern Window desktop_window;
@ -210,10 +214,6 @@ extern Pixmap get_desktop_pixmap(void);
#endif
extern void shaped_window_apply_mask(Drawable, Pixmap);
extern void set_icon_pixmap(char *, XWMHints *);
#ifdef USE_EFFECTS
extern int fade_in(ImlibImage *, int);
extern int fade_out(ImlibImage *, int);
#endif
_XFUNCPROTOEND

View File

@ -10,6 +10,7 @@ static const char cvs_ident[] = "$Id$";
/* includes */
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
@ -21,6 +22,7 @@ static const char cvs_ident[] = "$Id$";
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#include <fcntl.h>
#include <errno.h>
#include <X11/Xatom.h>
#include <X11/Xmd.h> /* CARD32 */

View File

@ -563,8 +563,9 @@ scrollbar_draw_anchor(unsigned char image_state, unsigned char force_modes) {
imlib_t *iml = images[image_st].current->iml, *siml = images[image_sa].current->iml;
if (image_mode_is(image_st, MODE_IMAGE) && iml->im) {
tw = iml->im->rgb_width;
th = iml->im->rgb_height;
imlib_context_set_image(iml->im);
tw = imlib_image_get_width();
th = imlib_image_get_height();
} else if (siml->bevel) {
tw = scrollbar_anchor_width() - (siml->bevel->edges->left + siml->bevel->edges->right);
th = scrollbar_anchor_width() - (siml->bevel->edges->top + siml->bevel->edges->bottom);

View File

@ -26,7 +26,7 @@
#include <X11/Xfuncproto.h>
#include <ctype.h>
#include <Imlib.h>
#include <Imlib2.h>
#include "events.h"
/************ Macros and Definitions ************/

View File

@ -79,8 +79,6 @@ eterm_bootstrap(int argc, char *argv[])
int i;
char *val;
static char windowid_string[20], *display_string, *term_string; /* "WINDOWID=\0" = 10 chars, UINT_MAX = 10 chars */
ImlibInitParams params;
orig_argv0 = argv[0];
/* Security enhancements -- mej */
@ -90,6 +88,7 @@ eterm_bootstrap(int argc, char *argv[])
my_rgid = getgid();
my_egid = getegid();
privileges(REVERT);
install_handlers();
PABLO_START_TRACING();
getcwd(initial_dir, PATH_MAX);
@ -127,28 +126,12 @@ eterm_bootstrap(int argc, char *argv[])
if (Options & Opt_install) {
cmap = XCreateColormap(Xdisplay, Xroot, Xvisual, AllocNone);
XInstallColormap(Xdisplay, cmap);
#ifdef PIXMAP_SUPPORT
params.cmap = cmap;
params.flags = PARAMS_COLORMAP;
#endif
} else {
cmap = Xcmap;
#ifdef PIXMAP_SUPPORT
params.flags = 0;
#endif
}
/* Since we always use Imlib now, let's initialize it here. */
#ifdef PIXMAP_SUPPORT
if (params.flags) {
imlib_id = Imlib_init_with_params(Xdisplay, &params);
} else {
imlib_id = Imlib_init(Xdisplay);
}
if (!imlib_id) {
fatal_error("Unable to initialize Imlib. Aborting.");
}
#endif
imlib_context_set_display(Xdisplay);
imlib_context_set_visual(Xvisual);
imlib_context_set_colormap(cmap);
get_modifiers(); /* Set up modifier masks before parsing config files. */

View File

@ -42,6 +42,17 @@ static const char cvs_ident[] = "$Id$";
#include "misc.h"
#include "system.h"
static RETSIGTYPE dummy_handler(int);
static sighandler_t old_handler = (sighandler_t) NULL;
static RETSIGTYPE
dummy_handler(int sig)
{
signal(SIGCHLD, old_handler);
SIG_RETURN(0);
}
int
wait_for_chld(int system_pid)
{
@ -88,6 +99,7 @@ system_wait(char *command)
D_OPTIONS(("system_wait(%s) called.\n", command));
old_handler = signal(SIGCHLD, dummy_handler);
if (!(pid = fork())) {
setreuid(my_ruid, my_ruid);
setregid(my_rgid, my_rgid);
@ -108,6 +120,7 @@ system_no_wait(char *command)
D_OPTIONS(("system_no_wait(%s) called.\n", command));
old_handler = signal(SIGCHLD, dummy_handler);
if (!(pid = fork())) {
setreuid(my_ruid, my_ruid);
setregid(my_rgid, my_rgid);

View File

@ -1072,8 +1072,10 @@ process_csi_seq(void)
unsigned short len;
if (background_is_pixmap()) {
char *fname = images[image_bg].current->iml->im->filename;
const char *fname;
imlib_context_set_image(images[image_bg].current->iml->im);
fname = imlib_image_get_filename();
len = strlen(fname) + sizeof(APL_NAME) + sizeof(VERSION) + 5;
tbuff = MALLOC(len);
snprintf(tbuff, len, APL_NAME "-" VERSION ": %s", fname);
@ -1757,7 +1759,7 @@ xterm_seq(int op, const char *str)
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_TRANS) && image_mode_is(idx, ALLOW_TRANS)) { \
image_set_mode(idx, MODE_TRANS); \
if (images[idx].current->pmap->pixmap != None) { \
Imlib_free_pixmap(imlib_id, images[idx].current->pmap->pixmap); \
imlib_free_pixmap_and_mask(images[idx].current->pmap->pixmap); \
} \
images[idx].current->pmap->pixmap = None; \
});
@ -1774,7 +1776,7 @@ xterm_seq(int op, const char *str)
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_TRANS) && image_mode_is(idx, ALLOW_TRANS)) { \
image_set_mode(idx, MODE_TRANS); \
if (images[idx].current->pmap->pixmap != None) { \
Imlib_free_pixmap(imlib_id, images[idx].current->pmap->pixmap); \
imlib_free_pixmap_and_mask(images[idx].current->pmap->pixmap); \
} \
images[idx].current->pmap->pixmap = None; \
} else if (image_mode_is(idx, MODE_TRANS)) {if (image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);} \
@ -1837,7 +1839,7 @@ xterm_seq(int op, const char *str)
imlib_t *iml = images[which].current->iml;
if (iml->mod == NULL) {
iml->mod = (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier));
iml->mod = (colormod_t *) MALLOC(sizeof(colormod_t));
iml->mod->brightness = iml->mod->contrast = iml->mod->gamma = 0x100;
}
if (!BEG_STRCASECMP("brightness", mod)) {
@ -1852,7 +1854,7 @@ xterm_seq(int op, const char *str)
imlib_t *iml = images[which].current->iml;
if (iml->rmod == NULL) {
iml->rmod = (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier));
iml->rmod = (colormod_t *) MALLOC(sizeof(colormod_t));
iml->rmod->brightness = iml->rmod->contrast = iml->rmod->gamma = 0x100;
}
if (!BEG_STRCASECMP("brightness", mod)) {
@ -1867,7 +1869,7 @@ xterm_seq(int op, const char *str)
imlib_t *iml = images[which].current->iml;
if (iml->gmod == NULL) {
iml->gmod = (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier));
iml->gmod = (colormod_t *) MALLOC(sizeof(colormod_t));
iml->gmod->brightness = iml->gmod->contrast = iml->gmod->gamma = 0x100;
}
if (!BEG_STRCASECMP("brightness", mod)) {
@ -1882,7 +1884,7 @@ xterm_seq(int op, const char *str)
imlib_t *iml = images[which].current->iml;
if (iml->bmod == NULL) {
iml->bmod = (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier));
iml->bmod = (colormod_t *) MALLOC(sizeof(colormod_t));
iml->bmod->brightness = iml->bmod->contrast = iml->bmod->gamma = 0x100;
}
if (!BEG_STRCASECMP("brightness", mod)) {
@ -1931,7 +1933,7 @@ xterm_seq(int op, const char *str)
}
} else {
if (iml->mod == NULL) {
iml->mod = (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier));
iml->mod = (colormod_t *) MALLOC(sizeof(colormod_t));
iml->mod->contrast = iml->mod->gamma = 0x100;
}
if (iml->mod->brightness != s) {
@ -1962,7 +1964,7 @@ xterm_seq(int op, const char *str)
}
} else {
if (iml->rmod == NULL) {
iml->rmod = (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier));
iml->rmod = (colormod_t *) MALLOC(sizeof(colormod_t));
iml->rmod->contrast = iml->rmod->gamma = 0x100;
}
if (iml->rmod->brightness != (int) r) {
@ -1983,7 +1985,7 @@ xterm_seq(int op, const char *str)
}
} else {
if (iml->gmod == NULL) {
iml->gmod = (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier));
iml->gmod = (colormod_t *) MALLOC(sizeof(colormod_t));
iml->gmod->contrast = iml->gmod->gamma = 0x100;
}
if (iml->gmod->brightness != (int) g) {
@ -2004,7 +2006,7 @@ xterm_seq(int op, const char *str)
}
} else {
if (iml->bmod == NULL) {
iml->bmod = (ImlibColorModifier *) MALLOC(sizeof(ImlibColorModifier));
iml->bmod = (colormod_t *) MALLOC(sizeof(colormod_t));
iml->bmod->contrast = iml->bmod->gamma = 0x100;
}
if (iml->bmod->brightness != (int) b) {

View File

@ -137,7 +137,6 @@ get_bottom_shadow_color(Pixel norm_color, const char *type)
{
XColor xcol;
int r, g, b;
xcol.pixel = norm_color;
XQueryColor(Xdisplay, cmap, &xcol);
@ -145,13 +144,9 @@ get_bottom_shadow_color(Pixel norm_color, const char *type)
xcol.red /= 2;
xcol.green /= 2;
xcol.blue /= 2;
r = xcol.red;
g = xcol.green;
b = xcol.blue;
xcol.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.", type, xcol.pixel, r, g, b);
print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.", type, xcol.pixel, xcol.red, xcol.green, xcol.blue);
xcol.pixel = PixColors[minColor];
}
return (xcol.pixel);
@ -162,11 +157,9 @@ get_top_shadow_color(Pixel norm_color, const char *type)
{
XColor xcol, white;
int r, g, b;
# ifdef PREFER_24BIT
white.red = white.green = white.blue = r = g = b = ~0;
white.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
XAllocColor(Xdisplay, cmap, &white);
# else
white.pixel = WhitePixel(Xdisplay, Xscreen);
@ -183,13 +176,9 @@ get_top_shadow_color(Pixel norm_color, const char *type)
xcol.red = MIN(white.red, (xcol.red * 7) / 5);
xcol.green = MIN(white.green, (xcol.green * 7) / 5);
xcol.blue = MIN(white.blue, (xcol.blue * 7) / 5);
r = xcol.red;
g = xcol.green;
b = xcol.blue;
xcol.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.", type, xcol.pixel, r, g, b);
print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.", type, xcol.pixel, xcol.red, xcol.green, xcol.blue);
xcol.pixel = PixColors[WhiteColor];
}
return (xcol.pixel);
@ -219,17 +208,6 @@ get_color_by_name(const char *name, const char *fallback)
return ((Pixel) -1);
}
}
if (Xdepth < 24) {
int r, g, b;
r = xcol.red;
g = xcol.green;
b = xcol.blue;
xcol.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
xcol.red = r;
xcol.green = g;
xcol.blue = b;
}
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
print_warning("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map. Falling back on \"%s\".",
name, xcol.pixel, xcol.red, xcol.green, xcol.blue, NONULL(fallback));
@ -260,17 +238,6 @@ get_color_by_pixel(Pixel pixel, Pixel fallback)
return ((Pixel) 0);
}
}
if (Xdepth < 24) {
int r, g, b;
r = xcol.red;
g = xcol.green;
b = xcol.blue;
xcol.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
xcol.red = r;
xcol.green = g;
xcol.blue = b;
}
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
print_warning("Unable to allocate 0x%08x (0x%04x, 0x%04x, 0x%04x) in the color map. Falling back on 0x%08x.", xcol.pixel, xcol.red, xcol.green, xcol.blue, fallback);
xcol.pixel = fallback;
@ -643,12 +610,9 @@ stored_palette(char op)
void
set_window_color(int idx, const char *color)
{
XColor xcol;
int i;
unsigned int pixel, r, g, b;
printf("idx == %d, color == \"%s\"\n", idx, NONULL(color));
D_X11(("idx == %d, color == \"%s\"\n", idx, NONULL(color)));
if (color == NULL || *color == '\0')
@ -673,11 +637,6 @@ set_window_color(int idx, const char *color)
return;
}
} else if (XParseColor(Xdisplay, cmap, color, &xcol)) {
r = xcol.red;
g = xcol.green;
b = xcol.blue;
pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
xcol.pixel = pixel;
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
print_warning("Unable to allocate \"%s\" in the color map.", color);
return;

View File

@ -148,7 +148,7 @@ begin main
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type anchor
@ -157,11 +157,11 @@ begin main
color black #666666
file bar_vertical_1.png
geom :scale
border 2 2 2 2
border 2 2 2 3
state selected
file bar_vertical_2.png
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type thumb
@ -217,11 +217,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
end image
begin image
type submenu
@ -250,11 +250,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state disabled
color white #333333
cmod image 0xc0
border 2 2 2 2
border 2 3 2 2
end image
begin image
type button
@ -263,15 +263,15 @@ begin main
color black #cccccc
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state clicked
file bar_horizontal_3.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
end image
end

View File

@ -1,187 +0,0 @@
# active.tags.X -- X Window System tag configuration
# Nat Friedman <ndf@mit.edu>
# It's actually faster to split up the regexps in many cases.
# URLs
{
Env=X
Regexp=http+s?://[^\ "<>'()]+
Binding=Button3
Highlight=Blue
SearchLines=4
Action=export NS="`ps auxw |grep netscape |grep -v grep`"; if [ "$NS" = "" ]; then netscape "${}"& else netscape -remote "openURL(\"${}\")"; fi
}
# URLs that don't begin with "http://"
{
Env=X
Regexp=www\.+[^\ ,"]+/?[^\ ,"<>()]+
Binding=Button3
Highlight=Blue
SearchLines=2
Action=export NS="`ps auxw |grep netscape |grep -v grep`"; if [ "$NS" = "" ]; then netscape "${}"& else netscape -remote "openURL(\"${}\")"; fi
}
# FTP URLs
{
Env=X
Regexp=ftp://[^\ ,<>]+
Binding=Button3
Highlight=Blue
SearchLines=2
Action=Action=export NS="`ps -auxw |grep netscape |grep -v grep`"; if [ "$NS" = "" ]; then netscape "${}" & else netscape -remote 'openURL("${}")'; fi
}
# Resolve an IP address and type the hostname into the shell
{
Env=X
Regexp=[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?
Output=loop
Binding=Button3
Highlight=Green
Clue=Resolve this IP address and type the hostname into the shell
Action=echo -n "`host ${} |grep Name |cut -d ' ' -f 2`"
}
# Resolve an IP address and pop the hostname up
{
Env=X
Regexp=[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?
Binding=Button3&Shift
Highlight=Green
Clue=Resolve this IP address and pop up a window with the hostname
Action=xmessage "`host ${} |grep Name |cut -d ' ' -f 2`" -nearmouse
}
# Directory browser
{
Env=X
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=([^\ ]+/)
Output=loop
Highlight=*Green
Binding=Button3
Action=echo -e 'clear;cd ${};ls -F;echo ".."'
}
{
Env=X
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=\.\.+
Output=loop
Highlight=*Yellow
Binding=Button3
Action=echo -e 'clear;cd ${};ls -F;if [ "$PWD" = "/" ]; then echo -n ; else echo ".." ; fi;'
}
# View images
{
Env=X
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=[^\ ]+\.jpg+|[^\ ]+\.jpeg+|[^\ ]+\.gif+|[^\ ]+\.ppm+
Highlight=Red
Binding=Button3
Clue=View this image
Action=xv -quit ${}
}
# View HTML files
{
Env=X
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=[^\ "<>]+\.html+
Highlight=Yellow
Clue=Send this HTML file to Netscape
Action=netscape -remote "openURL(${})"
}
# Uncompress and untar .tar.gz and .tgz files.
{
Env=X
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=[^\ "'`=]+(tar\.gz|\.tgz|tar\.Z)
Output=Loop
Highlight=Magenta
Clue=Uncompress and untar this file
Action=echo -n "tar -xvzf ${}"
}
# Unzip .zip files.
{
Env=X
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=[^\ "'`=]+\.zip
Output=Loop
Highlight=Magenta
Clue=Unzip this file
Action=echo -n "unzip -v ${}"
}
# Untar .tar files.
{
Env=X
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=[^\ "'`=]+\.tar
Output=Loop
Highlight=Magenta
Clue=Untar this file
Action=echo -n "tar -xvf ${}"
}
# The following two tags will ghostview a .ps file if you right-click it,
# and print it if you shift-right-click it.
{
Env=X
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=[^\ ]+\.ps
Binding=Button3
Highlight=Underline
Clue=Send this file to ghostview
Action=ghostview ${}
}
{
Modes=bash,-bash,sh,-sh,csh,-csh,tcsh,-tcsh,ksh,-ksh,zsh,-zsh
Regexp=[^\ ]+\.ps
Binding=Button3&Shift
Highlight=Underline
Clue=Print this file
Action=lpr ${}
}
#spell check a word
{
Env=X
Regexp=[^\ ]+
Latent=true
Binding=Button1&Meta
Highlight=Normal
Output=loop
Clue=Spell check this word
Action=xmessage "`echo ${} |ispell -a |grep -v Ispell`"
}
# End of file

View File

@ -148,7 +148,7 @@ begin main
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type anchor
@ -157,11 +157,11 @@ begin main
color black #666666
file bar_vertical_1.png
geom :scale
border 2 2 2 2
border 2 2 2 3
state selected
file bar_vertical_2.png
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type thumb
@ -217,11 +217,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
end image
begin image
type submenu
@ -250,11 +250,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state disabled
color white #333333
cmod image 0xc0
border 2 2 2 2
border 2 3 2 2
end image
begin image
type button
@ -263,15 +263,15 @@ begin main
color black #cccccc
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state clicked
file bar_horizontal_3.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
end image
end

View File

@ -147,7 +147,7 @@ begin main
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type anchor
@ -156,11 +156,11 @@ begin main
color black #666666
file bar_vertical_1.png
geom :scale
border 2 2 2 2
border 2 2 2 3
state selected
file bar_vertical_2.png
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type thumb
@ -216,11 +216,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
end image
begin image
type submenu
@ -249,11 +249,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state disabled
color white #333333
cmod image 0xc0
border 2 2 2 2
border 2 3 2 2
end image
begin image
type button
@ -262,15 +262,15 @@ begin main
color black #cccccc
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state clicked
file bar_horizontal_3.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
end image
end

View File

@ -148,7 +148,7 @@ begin main
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type anchor
@ -157,11 +157,11 @@ begin main
color black #666666
file bar_vertical_1.png
geom :scale
border 2 2 2 2
border 2 2 2 3
state selected
file bar_vertical_2.png
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type thumb
@ -217,11 +217,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
end image
begin image
type submenu
@ -250,11 +250,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state disabled
color white #333333
cmod image 0xc0
border 2 2 2 2
border 2 3 2 2
end image
begin image
type button
@ -263,15 +263,15 @@ begin main
color black #cccccc
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state clicked
file bar_horizontal_3.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
end image
end

View File

@ -148,7 +148,7 @@ begin main
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type anchor
@ -157,11 +157,11 @@ begin main
color black #666666
file bar_vertical_1.png
geom :scale
border 2 2 2 2
border 2 2 2 3
state selected
file bar_vertical_2.png
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type thumb
@ -217,11 +217,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
end image
begin image
type submenu
@ -250,11 +250,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state disabled
color white #333333
cmod image 0xc0
border 2 2 2 2
border 2 3 2 2
end image
begin image
type button
@ -263,15 +263,15 @@ begin main
color black #cccccc
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state clicked
file bar_horizontal_3.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
end image
end

View File

@ -150,7 +150,7 @@ begin main
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type anchor
@ -159,11 +159,11 @@ begin main
color black #666666
file bar_vertical_1.png
geom :scale
border 2 2 2 2
border 2 2 2 3
state selected
file bar_vertical_2.png
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type thumb
@ -219,11 +219,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
end image
begin image
type submenu
@ -252,11 +252,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state disabled
color white #333333
cmod image 0xc0
border 2 2 2 2
border 2 3 2 2
end image
begin image
type button
@ -265,15 +265,15 @@ begin main
color black #cccccc
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state clicked
file bar_horizontal_3.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
end image
end

View File

@ -147,7 +147,7 @@ begin main
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type anchor
@ -156,11 +156,11 @@ begin main
color black #666666
file bar_vertical_1.png
geom :scale
border 2 2 2 2
border 2 2 2 3
state selected
file bar_vertical_2.png
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type thumb
@ -216,11 +216,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
end image
begin image
type submenu
@ -249,11 +249,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state disabled
color white #333333
cmod image 0xc0
border 2 2 2 2
border 2 3 2 2
end image
begin image
type button
@ -262,15 +262,15 @@ begin main
color black #cccccc
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state clicked
file bar_horizontal_3.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
end image
end

View File

@ -148,7 +148,7 @@ begin main
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type anchor
@ -157,11 +157,11 @@ begin main
color black #666666
file bar_vertical_1.png
geom :scale
border 2 2 2 2
border 2 2 2 3
state selected
file bar_vertical_2.png
geom :scale
border 2 2 2 2
border 2 2 2 3
end image
begin image
type thumb
@ -217,11 +217,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 3
end image
begin image
type submenu
@ -250,11 +250,11 @@ begin main
color black #999999
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state disabled
color white #333333
cmod image 0xc0
border 2 2 2 2
border 2 3 2 2
end image
begin image
type button
@ -263,15 +263,15 @@ begin main
color black #cccccc
file bar_horizontal_1.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state selected
file bar_horizontal_2.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
state clicked
file bar_horizontal_3.png
geom 100x100+0+0:scale
border 2 2 2 2
border 2 3 2 2
end image
end

View File

@ -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);
}