Mon Sep 20 18:32:01 PDT 1999 Michael Jennings <mej@eterm.org>

Lots of changes here.  First off, this should fix the background draw
	bug with transparency that several people pointed out.  While I was
	at it, I also cleaned up a lot of other related stuff.  Three-state
	images should be a lot more robust now.

	Then again, some stuff may be broken entirely from this, so let me
	know. :-)

	For one thing, the various image modes should work as expected now.
	You can allow and disallow modes for the various widgets.  The
	fallback mode is "solid" now, rather than "image," so you can cause
	a certain widget to refuse to use an image if you want to.  If you
	specify an image without specifying a "mode" line that allows the
	"image" mode, your image will not appear. <-- READ THIS TWICE!  I
	had to go back and fix all the theme files because of this, so you
	will need to remove your current theme directory and allow Eterm's
	"make install" to put the new ones in place; otherwise, everything
	will go back to being solid colors. =]

	Anytime something changes this drastically, there are bound to be
	problems.  Let me know if you find any of them. :)


SVN revision: 348
eterm-0.10
Michael Jennings 24 years ago
parent e4070d2075
commit e700e69dff
  1. 25
      ChangeLog
  2. 2
      bg/Makefile.am
  3. 31
      src/events.c
  4. 14
      src/menus.c
  5. 3
      src/menus.h
  6. 1
      src/misc.c
  7. 62
      src/options.c
  8. 40
      src/options.h
  9. 83
      src/pixmap.c
  10. 41
      src/pixmap.h
  11. 29
      src/scrollbar.c
  12. 51
      src/scrollbar.h
  13. 124
      src/term.c
  14. 1
      src/term.h
  15. 55
      src/windows.c
  16. 45
      themes/Eterm/theme.cfg.in
  17. 45
      themes/cEterm/theme.cfg.in
  18. 45
      themes/chooser/theme.cfg.in
  19. 45
      themes/emacs/theme.cfg.in
  20. 53
      themes/irc/theme.cfg.in
  21. 50
      themes/mutt/theme.cfg.in
  22. 47
      themes/trans/theme.cfg.in

@ -2402,3 +2402,28 @@ Thu Sep 16 16:21:22 PDT 1999 Michael Jennings <mej@eterm.org>
from the themes for the time being.
-------------------------------------------------------------------------------
Mon Sep 20 18:32:01 PDT 1999 Michael Jennings <mej@eterm.org>
Lots of changes here. First off, this should fix the background draw
bug with transparency that several people pointed out. While I was
at it, I also cleaned up a lot of other related stuff. Three-state
images should be a lot more robust now.
Then again, some stuff may be broken entirely from this, so let me
know. :-)
For one thing, the various image modes should work as expected now.
You can allow and disallow modes for the various widgets. The
fallback mode is "solid" now, rather than "image," so you can cause
a certain widget to refuse to use an image if you want to. If you
specify an image without specifying a "mode" line that allows the
"image" mode, your image will not appear. <-- READ THIS TWICE! I
had to go back and fix all the theme files because of this, so you
will need to remove your current theme directory and allow Eterm's
"make install" to put the new ones in place; otherwise, everything
will go back to being solid colors. =]
Anytime something changes this drastically, there are bound to be
problems. Let me know if you find any of them. :)
-------------------------------------------------------------------------------

@ -28,7 +28,7 @@ install-data-hook:
for i in `ls -1 | grep -v CVS | grep -v \.cvsignore | grep -v pixmaps.list` ; do \
echo $(INSTALL_DATA) $$i $(DESTDIR)${pixmapdir} ; \
$(INSTALL_DATA) $$i $(DESTDIR)${pixmapdir} ; \
done ; \
done ; cd .. ; \
done)
@for i in tiled-pixmaps.list scaled-pixmaps.list pixmaps.list ; do \
if test -f $(DESTDIR)${pixmapdir}/$$i ; then \

@ -229,22 +229,23 @@ handle_property_notify(event_t * ev)
D_EVENTS(("handle_property_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
if (((Options & Opt_pixmapTrans) || (images[image_bg].mode & MODE_TRANS)) && (desktop_window != None)) {
if (background_is_trans()) {
if (ev->xany.window == TermWin.parent) {
prop = XInternAtom(Xdisplay, "_WIN_WORKSPACE", True);
if ((prop == None) || (ev->xproperty.atom != prop)) {
return 0;
}
XSelectInput(Xdisplay, desktop_window, None);
desktop_window = get_desktop_window();
XSelectInput(Xdisplay, desktop_window, PropertyChangeMask);
if (desktop_pixmap != None) {
free_desktop_pixmap();
}
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
scrollbar_show(0);
desktop_window = get_desktop_window();
if (desktop_window == None) {
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {image_set_mode(idx, MODE_IMAGE); image_allow_mode(idx, ALLOW_IMAGE);});
return 1;
}
XSelectInput(Xdisplay, desktop_window, PropertyChangeMask);
redraw_all_images();
} else if (ev->xany.window == desktop_window) {
prop = XInternAtom(Xdisplay, "_XROOTPMAP_ID", True);
if ((prop == None) || (ev->xproperty.atom != prop)) {
@ -253,9 +254,7 @@ handle_property_notify(event_t * ev)
if (desktop_pixmap != None) {
free_desktop_pixmap();
}
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
scrollbar_show(0);
redraw_all_images();
}
}
return 1;
@ -345,10 +344,9 @@ handle_focus_in(event_t * ev)
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
if (!TermWin.focus) {
TermWin.focus = 1;
if (background_is_pixmap() && (images[image_bg].norm != images[image_bg].selected)) {
if (images[image_bg].norm != images[image_bg].selected) {
images[image_bg].current = images[image_bg].selected;
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
redraw_image(image_bg);
}
if (Options & Opt_scrollbar_popup) {
map_scrollbar(Options & Opt_scrollBar);
@ -370,10 +368,9 @@ handle_focus_out(event_t * ev)
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
if (TermWin.focus) {
TermWin.focus = 0;
if (background_is_pixmap() && (images[image_bg].norm != images[image_bg].selected)) {
if (images[image_bg].norm != images[image_bg].selected) {
images[image_bg].current = images[image_bg].norm;
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
redraw_image(image_bg);
}
if (Options & Opt_scrollbar_popup) {
map_scrollbar(0);
@ -400,7 +397,7 @@ handle_configure_notify(event_t * ev)
#ifdef USE_XIM
xim_set_status_position();
#endif
return 1;
return 0;
}
unsigned char

@ -638,8 +638,6 @@ unsigned char
menuitem_set_action(menuitem_t * item, unsigned char type, char *action)
{
unsigned long len;
ASSERT_RVAL(item != NULL, 0);
item->type = type;
@ -770,7 +768,9 @@ menuitem_select(menu_t * menu, menuitem_t * item)
XMoveWindow(Xdisplay, menu->swin, item->x, item->y);
XMapWindow(Xdisplay, menu->swin);
if (item->type == MENUITEM_SUBMENU) {
paste_simage(images[image_submenu].selected, menu->swin, 0, 0, item->w - MENU_VGAP, item->h);
if (image_mode_is(image_submenu, MODE_IMAGE) && image_mode_is(image_submenu, ALLOW_IMAGE)) {
paste_simage(images[image_submenu].selected, menu->swin, 0, 0, item->w - MENU_VGAP, item->h);
}
} else {
render_simage(images[image_menu].selected, menu->swin, item->w - MENU_VGAP, item->h, image_menu, 0);
}
@ -792,7 +792,9 @@ menuitem_deselect(menu_t * menu, menuitem_t * item)
XUnmapWindow(Xdisplay, menu->swin);
if (find_item_in_menu(menu, item) != (unsigned short) -1) {
if (item->type == MENUITEM_SUBMENU) {
paste_simage(images[image_submenu].norm, menu->win, item->x, item->y, item->w - MENU_VGAP, item->h);
if (image_mode_is(image_submenu, MODE_IMAGE) && image_mode_is(image_submenu, ALLOW_IMAGE)) {
paste_simage(images[image_submenu].norm, menu->win, item->x, item->y, item->w - MENU_VGAP, item->h);
}
}
draw_string(menu->win, menu->gc, 2 * MENU_HGAP, item->y + item->h - MENU_VGAP, item->text, item->len);
if (item->rtext) {
@ -931,7 +933,9 @@ menu_draw(menu_t * menu)
}
switch (item->type) {
case MENUITEM_SUBMENU:
paste_simage(images[image_submenu].norm, menu->win, item->x, item->y, item->w - MENU_VGAP, item->h);
if (image_mode_is(image_submenu, MODE_IMAGE) && image_mode_is(image_submenu, ALLOW_IMAGE)) {
paste_simage(images[image_submenu].norm, menu->win, item->x, item->y, item->w - MENU_VGAP, item->h);
}
break;
case MENUITEM_STRING:
#if 0

@ -47,7 +47,8 @@
#define MENU_VGAP 4
#define MENU_CLICK_TIME 20
#define menu_is_pixmapped() (images[image_menu].current->iml->im)
#define menu_is_pixmapped() ((images[image_menu].current->iml->im) && (images[image_menu].mode & MODE_MASK))
#define menu_submenu_is_pixmapped() ((images[image_submenu].current->iml->im) && (images[image_submenu].mode & MODE_MASK))
/************ Structures ************/
typedef struct menu_t_struct menu_t;

@ -174,7 +174,6 @@ parse_escaped_string(char *str)
register char *pold, *pnew;
unsigned char i;
size_t len = strlen(str);
D_STRINGS(("parse_escaped_string(\"%s\")\n", str));

@ -183,7 +183,7 @@ eterm_func builtins[] =
{"appname", builtin_appname, 0},
{(char *) NULL, (eterm_function_ptr) NULL, 0}
};
unsigned long Options = (Opt_scrollBar);
unsigned long Options = (Opt_scrollBar), image_toggles = 0;
static menu_t *curmenu;
char *theme_dir = NULL, *user_dir = NULL;
char **rs_execArgs = NULL; /* Args to exec (-e or --exec) */
@ -264,10 +264,6 @@ char *rs_anim_pixmap_list = NULL;
char **rs_anim_pixmaps = NULL;
time_t rs_anim_delay = 0;
# endif
# ifdef PIXMAP_OFFSET
char *rs_viewport_mode = NULL;
const char *rs_pixmapTrans = NULL;
# endif
static char *rs_pixmaps[image_max];
#endif
char *rs_noCursor = NULL;
@ -380,14 +376,12 @@ static const struct {
OPT_LONG("trough-pixmap", "scrollbar background (trough) pixmap [scaling optional]", &rs_pixmaps[image_sb]),
OPT_LONG("anchor-pixmap", "scrollbar anchor pixmap [scaling optional]", &rs_pixmaps[image_sa]),
OPT_LONG("menu-pixmap", "menu pixmap [scaling optional]", &rs_pixmaps[image_menu]),
OPT_BOOL('@', "scale", "scale rather than tile", &rs_pixmapScale, &Options, Opt_pixmapScale),
# ifdef PIXMAP_OFFSET
OPT_BOOL('O', "trans", "creates a pseudo-transparent Eterm", &rs_pixmapTrans, &Options, Opt_pixmapTrans),
OPT_BOOL('O', "trans", "creates a pseudo-transparent Eterm", NULL, &image_toggles, IMOPT_TRANS),
OPT_BLONG("viewport-mode", "use viewport mode for the background image", NULL, &image_toggles, IMOPT_VIEWPORT),
OPT_LONG("cmod", "image color modifier (\"brightness contrast gamma\")", &rs_cmod_image),
OPT_LONG("cmod-red", "red-only color modifier (\"brightness contrast gamma\")", &rs_cmod_red),
OPT_LONG("cmod-green", "green-only color modifier (\"brightness contrast gamma\")", &rs_cmod_green),
OPT_LONG("cmod-blue", "blue-only color modifier (\"brightness contrast gamma\")", &rs_cmod_blue),
# endif
OPT_STR('p', "path", "pixmap file search path", &rs_path),
# ifdef BACKGROUND_CYCLING_SUPPORT
OPT_STR('N', "anim", "a delay and list of pixmaps for cycling", &rs_anim_pixmap_list),
@ -436,9 +430,6 @@ static const struct {
OPT_BLONG("select-line", "triple-click selects whole line", &rs_select_whole_line, &Options, Opt_select_whole_line),
OPT_BLONG("select-trailing-spaces", "do not skip trailing spaces when selecting", &rs_select_trailing_spaces, &Options, Opt_select_trailing_spaces),
OPT_BLONG("report-as-keysyms", "report special keys as keysyms", &rs_report_as_keysyms, &Options, Opt_report_as_keysyms),
#ifdef PIXMAP_OFFSET
OPT_BLONG("viewport-mode", "use viewport mode for the background image", &rs_viewport_mode, &Options, Opt_viewport_mode),
#endif
/* =======[ Keyboard options ]======= */
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
@ -2471,13 +2462,13 @@ parse_image(char *buff)
return;
}
if (!BEG_STRCASECMP(mode, "image ")) {
images[idx].mode = MODE_IMAGE;
images[idx].mode = (MODE_IMAGE | ALLOW_IMAGE);
} else if (!BEG_STRCASECMP(mode, "trans ")) {
images[idx].mode = MODE_TRANS;
images[idx].mode = (MODE_TRANS | ALLOW_TRANS);
} else if (!BEG_STRCASECMP(mode, "viewport ")) {
images[idx].mode = MODE_VIEWPORT;
images[idx].mode = (MODE_VIEWPORT | ALLOW_VIEWPORT);
} else if (!BEG_STRCASECMP(mode, "auto ")) {
images[idx].mode = MODE_AUTO;
images[idx].mode = (MODE_AUTO | ALLOW_AUTO);
} else {
print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"", file_peek_path(), file_peek_line(), mode);
}
@ -2680,7 +2671,7 @@ parse_actions(char *buff)
unsigned short mod = MOD_NONE;
unsigned char button = BUTTON_NONE;
KeySym keysym = 0;
char *to, *str;
char *str;
unsigned short i;
ASSERT(buff != NULL);
@ -2851,16 +2842,16 @@ parse_menuitem(char *buff)
void
parse_xim(char *buff)
{
#ifdef USE_XIM
ASSERT(buff != NULL);
#ifdef USE_XIM
if (!BEG_STRCASECMP(buff, "input_method ")) {
rs_inputMethod = Word(2, buff);
} else if (!BEG_STRCASECMP(buff, "preedit_type ")) {
rs_preeditType = Word(2, buff);
} else {
print_error("Parse error in file %s, line %lu:\n"
"Attribute \"%s\" is not valid within context xim",
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context xim",
file_peek_path(), file_peek_line(), buff);
}
#else
@ -2872,23 +2863,22 @@ parse_xim(char *buff)
void
parse_multichar(char *buff)
{
#ifdef MULTI_CHARSET
ASSERT(buff != NULL);
#ifdef MULTI_CHARSET
if (!BEG_STRCASECMP(buff, "encoding ")) {
if ((rs_multchar_encoding = Word(2, buff)) != NULL) {
if (BEG_STRCASECMP(rs_multchar_encoding, "eucj")
&& BEG_STRCASECMP(rs_multchar_encoding, "sjis")
&& BEG_STRCASECMP(rs_multchar_encoding, "euckr")) {
print_error("Parse error in file %s, line %lu:"
" Invalid multichar encoding mode \"%s\"",
print_error("Parse error in file %s, line %lu: Invalid multichar encoding mode \"%s\"",
file_peek_path(), file_peek_line(), rs_multchar_encoding);
return;
}
set_multichar_encoding(rs_multchar_encoding);
} else {
print_error("Parse error in file %s, line %lu: "
" Invalid parameter list \"\" for attribute encoding",
print_error("Parse error in file %s, line %lu: Invalid parameter list \"\" for attribute encoding",
file_peek_path(), file_peek_line());
}
} else if (!BEG_STRCASECMP(buff, "font ")) {
@ -2897,8 +2887,7 @@ parse_multichar(char *buff)
unsigned char n;
if (NumWords(buff) != 3) {
print_error("Parse error in file %s, line %lu:"
" Invalid parameter list \"%s\" for attribute font",
print_error("Parse error in file %s, line %lu: Invalid parameter list \"%s\" for attribute font",
file_peek_path(), file_peek_line(), (tmp ? tmp : ""));
return;
}
@ -2907,25 +2896,21 @@ parse_multichar(char *buff)
if (n <= 4) {
rs_mfont[n] = Word(2, tmp);
} else {
print_error("Parse error in file %s, line %lu:"
" Invalid font index %d",
print_error("Parse error in file %s, line %lu: Invalid font index %d",
file_peek_path(), file_peek_line(), n);
}
} else {
tmp = Word(1, tmp);
print_error("Parse error in file %s, line %lu:"
" Invalid font index \"%s\"",
print_error("Parse error in file %s, line %lu: Invalid font index \"%s\"",
file_peek_path(), file_peek_line(), (tmp ? tmp : ""));
FREE(tmp);
}
} else {
print_error("Parse error in file %s, line %lu:"
" Attribute \"%s\" is not valid within context multichar",
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context multichar",
file_peek_path(), file_peek_line(), buff);
}
#else
print_warning("Multichar support was not compiled in,"
" ignoring entire context");
print_warning("Multichar support was not compiled in, ignoring entire context");
file_poke_skip(1);
#endif
}
@ -3357,6 +3342,13 @@ post_parse(void)
if (!(images[i].clicked)) {
images[i].clicked = images[i].selected;
}
if ((image_toggles & IMOPT_TRANS) && (image_mode_is(i, ALLOW_TRANS))) {
D_PIXMAP(("Detected transparency option. Enabling transparency on image %s\n", get_image_type(i)));
image_set_mode(i, MODE_TRANS);
} else if ((image_toggles & IMOPT_VIEWPORT) && (image_mode_is(i, ALLOW_VIEWPORT))) {
D_PIXMAP(("Detected viewport option. Enabling viewport mode on image %s\n", get_image_type(i)));
image_set_mode(i, MODE_VIEWPORT);
}
}
if (rs_cmod_image) {

@ -59,25 +59,25 @@
# define Opt_utmpLogging (1LU << 6)
# define Opt_scrollBar (1LU << 7)
# define Opt_meta8 (1LU << 8)
# define Opt_pixmapScale (1LU << 9)
# define Opt_exec (1LU << 10)
# define Opt_homeOnEcho (1LU << 11)
# define Opt_homeOnRefresh (1LU << 12)
# define Opt_scrollBar_floating (1LU << 13)
# define Opt_scrollBar_right (1LU << 14)
# define Opt_borderless (1LU << 15)
# define Opt_pixmapTrans (1LU << 16)
# define Opt_backing_store (1LU << 17)
# define Opt_noCursor (1LU << 18)
# define Opt_pause (1LU << 19)
# define Opt_homeOnInput (1LU << 20)
# define Opt_report_as_keysyms (1LU << 21)
# define Opt_xterm_select (1LU << 22)
# define Opt_select_whole_line (1LU << 23)
# define Opt_viewport_mode (1LU << 24)
# define Opt_scrollbar_popup (1LU << 25)
# define Opt_select_trailing_spaces (1LU << 26)
# define Opt_install (1LU << 27)
# define Opt_exec (1LU << 9)
# define Opt_homeOnEcho (1LU << 10)
# define Opt_homeOnRefresh (1LU << 11)
# define Opt_scrollBar_right (1LU << 12)
# define Opt_borderless (1LU << 13)
# define Opt_backing_store (1LU << 14)
# define Opt_noCursor (1LU << 15)
# define Opt_pause (1LU << 16)
# define Opt_homeOnInput (1LU << 17)
# define Opt_report_as_keysyms (1LU << 18)
# define Opt_xterm_select (1LU << 19)
# define Opt_select_whole_line (1LU << 20)
# define Opt_scrollbar_popup (1LU << 21)
# define Opt_select_trailing_spaces (1LU << 22)
# define Opt_install (1LU << 23)
# define Opt_scrollBar_floating (1LU << 24)
# define IMOPT_TRANS (1U << 0)
# define IMOPT_VIEWPORT (1U << 1)
#define BOOL_OPT_ISTRUE(s) (!strcasecmp((s), true_vals[0]) || !strcasecmp((s), true_vals[1]) \
|| !strcasecmp((s), true_vals[2]) || !strcasecmp((s), true_vals[3]))
@ -205,7 +205,7 @@ typedef struct eterm_function_struct {
} eterm_func;
/************ Variables ************/
extern unsigned long Options;
extern unsigned long Options, image_toggles;
extern char *theme_dir, *user_dir;
extern char **rs_execArgs; /* Args to exec (-e or --exec) */
extern char *rs_title; /* Window title */

@ -80,7 +80,7 @@ image_t images[image_max] =
#endif
#ifdef PIXMAP_SUPPORT
inline const char *
const char *
get_image_type(unsigned short type)
{
@ -338,7 +338,39 @@ paste_simage(simage_t * simg, Window win, unsigned short x, unsigned short y, un
}
void
render_simage(simage_t * simg, Window win, unsigned short width, unsigned short height, int which, renderop_t renderop)
redraw_image(unsigned char which) {
switch (which) {
case image_bg:
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 0);
scr_touch();
break;
case image_up:
render_simage(images[image_up].current, scrollbar_get_uparrow_win(), scrollbar_arrow_width(), scrollbar_arrow_width(), image_up, 0);
scrollbar_show(0);
break;
case image_down:
render_simage(images[image_down].current, scrollbar_get_downarrow_win(), scrollbar_arrow_width(), scrollbar_arrow_width(), image_down, 0);
scrollbar_show(0);
break;
# ifdef PIXMAP_SCROLLBAR
case image_sb:
render_simage(images[image_sb].current, scrollbar_get_win(), scrollbar_trough_width(), scrollbar_trough_height(), image_sb, 0);
scrollbar_show(0);
break;
case image_sa:
render_simage(images[image_sa].current, scrollbar_get_anchor_win(), scrollbar_anchor_width(), scrollbar_anchor_height(), image_sa, 0);
scrollbar_show(0);
break;
# endif
default:
D_PIXMAP(("redraw_image(): Bad value %u\n", which));
break;
}
}
void
render_simage(simage_t * simg, Window win, unsigned short width, unsigned short height, unsigned char which, renderop_t renderop)
{
XGCValues gcvalue;
@ -365,10 +397,10 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
ASSERT(simg->iml != NULL);
ASSERT(simg->pmap != NULL);
D_PIXMAP(("render_simage(): Rendering simg->iml->im 0x%08x (%s) at %hux%hu onto window 0x%08x\n", simg->iml->im, get_image_type(which),
width, height, win));
D_PIXMAP(("render_simage(): Rendering simg->iml->im 0x%08x (%s) at %hux%hu onto window 0x%08x\n", simg->iml->im, get_image_type(which), width, height, win));
D_PIXMAP(("render_simage(): Image mode is 0x%02x\n", images[which].mode));
if (which == image_bg && (Options & Opt_viewport_mode)) {
if ((which == image_bg) && image_mode_is(image_bg, MODE_VIEWPORT)) {
width = scr->width;
height = scr->height;
}
@ -412,16 +444,14 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
}
# ifdef PIXMAP_OFFSET
if (((Options & Opt_pixmapTrans) || (images[which].mode & MODE_TRANS)) && (images[which].mode & ALLOW_TRANS)) {
if (image_mode_is(which, MODE_TRANS) && image_mode_is(which, ALLOW_TRANS)) {
if (desktop_window == None) {
get_desktop_window();
}
if (desktop_window == None) {
print_error("Unable to locate desktop window. If you are running Enlightenment, please\n"
"restart. If not, please set your background image with Esetroot, then try again.");
Options &= ~(Opt_pixmapTrans);
images[which].mode |= (MODE_IMAGE | ALLOW_IMAGE);
images[which].mode &= ~(MODE_TRANS | ALLOW_TRANS);
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {image_set_mode(idx, MODE_IMAGE); image_allow_mode(idx, ALLOW_IMAGE);});
render_simage(simg, win, width, height, which, renderop);
return;
}
@ -453,7 +483,7 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
XFreePixmap(Xdisplay, simg->pmap->pixmap);
}
simg->pmap->pixmap = XCreatePixmap(Xdisplay, win, width, height, Xdepth);
D_PIXMAP(("desktop_pixmap == %08x, simg->pmap->pixmap == %08x\n", desktop_pixmap, simg->pmap->pixmap));
D_PIXMAP(("desktop_pixmap == 0x%08x, simg->pmap->pixmap == 0x%08x\n", desktop_pixmap, simg->pmap->pixmap));
if (simg->pmap->pixmap != None) {
XGetGeometry(Xdisplay, desktop_pixmap, &w, &px, &py, &pw, &ph, &pb, &pd);
if ((pw <= 0) || (ph <= 0)) {
@ -481,9 +511,8 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
D_PIXMAP(("Setting background of window 0x%08x to the background color\n", win));
XSetWindowBackground(Xdisplay, win, PixColors[bgColor]);
}
} else if (((Options & Opt_viewport_mode) || (images[which].mode & MODE_VIEWPORT)) && (images[which].mode & ALLOW_VIEWPORT)) {
D_PIXMAP(("Viewport mode enabled. viewport_pixmap == 0x%08x and simg->pmap->pixmap == 0x%08x\n",
viewport_pixmap, simg->pmap->pixmap));
} else if (image_mode_is(which, MODE_VIEWPORT) && image_mode_is(which, ALLOW_VIEWPORT)) {
D_PIXMAP(("Viewport mode enabled. viewport_pixmap == 0x%08x and simg->pmap->pixmap == 0x%08x\n", viewport_pixmap, simg->pmap->pixmap));
if (viewport_pixmap == None) {
imlib_t *tmp_iml = images[image_bg].current->iml;
@ -545,8 +574,7 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
XSetWindowBackgroundPixmap(Xdisplay, win, simg->pmap->pixmap);
} else
# endif
{
if (image_mode_is(which, MODE_IMAGE) && image_mode_is(which, ALLOW_IMAGE)) {
if (simg->iml->im) {
int w = simg->pmap->w;
int h = simg->pmap->h;
@ -664,6 +692,31 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
D_PIXMAP(("Setting background of window 0x%08x to 0x%08x\n", win, simg->pmap->pixmap));
XSetWindowBackgroundPixmap(Xdisplay, win, simg->pmap->pixmap);
}
} else {
unsigned short cidx;
switch (which) {
case image_up:
case image_down:
case image_left:
case image_right:
# ifdef PIXMAP_SCROLLBAR
case image_sb:
case image_sa:
# endif
cidx = (TermWin.focus ? scrollColor : unfocusedScrollColor);
break;
case image_menu:
case image_submenu:
cidx = (TermWin.focus ? menuColor : unfocusedMenuColor);
break;
default:
cidx = bgColor;
break;
}
XSetWindowBackground(Xdisplay, win, PixColors[cidx]);
image_set_mode(which, MODE_SOLID);
}
XClearWindow(Xdisplay, win);
XFreeGC(Xdisplay, gc);

@ -32,7 +32,8 @@
/************ Macros and Definitions ************/
#ifdef PIXMAP_SUPPORT
# define background_is_image() (images[image_bg].current && images[image_bg].current->iml && images[image_bg].current->iml->im)
# define background_is_pixmap() (background_is_image() || Options & Opt_pixmapTrans)
# define background_is_trans() (images[image_bg].mode & MODE_TRANS)
# define background_is_pixmap() (background_is_image() || background_is_trans())
# define delete_simage(simg) do { \
Imlib_free_pixmap(imlib_id, (simg)->pmap->pixmap); \
Imlib_destroy_image(imlib_id, (simg)->iml->im); \
@ -43,8 +44,9 @@
# define CONVERT_TINT_GREEN(t) (((t) & 0x00ff00) >> 8)
# define CONVERT_TINT_BLUE(t) ((t) & 0x0000ff)
#else
# define background_is_pixmap() ((int)0)
# define background_is_image() ((int)0)
# define background_is_trans() ((int)0)
# define background_is_pixmap() ((int)0)
# define delete_simage(simg) ((void)0)
#endif
#define PIXMAP_EXT NULL
@ -77,16 +79,27 @@ enum {
#define OP_SCALE (OP_HSCALE | OP_VSCALE)
/* Image modes */
#define MODE_IMAGE 0x00
#define MODE_TRANS 0x01
#define MODE_VIEWPORT 0x02
#define MODE_AUTO 0x04
#define MODE_MASK 0x07
#define ALLOW_IMAGE 0x00
#define ALLOW_TRANS 0x10
#define ALLOW_VIEWPORT 0x20
#define ALLOW_AUTO 0x40
#define ALLOW_MASK 0x70
#define MODE_SOLID 0x00
#define MODE_IMAGE 0x01
#define MODE_TRANS 0x02
#define MODE_VIEWPORT 0x04
#define MODE_AUTO 0x08
#define MODE_MASK 0x0f
#define ALLOW_SOLID 0x00
#define ALLOW_IMAGE 0x10
#define ALLOW_TRANS 0x20
#define ALLOW_VIEWPORT 0x40
#define ALLOW_AUTO 0x80
#define ALLOW_MASK 0xf0
/* Helper macros */
#define FOREACH_IMAGE(x) do {unsigned char idx; for (idx = 0; idx < image_max; idx++) { x } } while (0)
#define redraw_all_images() do {render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 0); \
scr_touch(); scrollbar_show(0);} while (0)
#define image_set_mode(which, bit) do {images[which].mode &= ~(MODE_MASK); images[which].mode |= (bit);} while (0)
#define image_allow_mode(which, bit) (images[which].mode |= (bit))
#define image_disallow_mode(which, bit) (images[which].mode &= ~(bit))
#define image_mode_is(which, bit) (images[which].mode & (bit))
/* Elements of an simage to be reset */
#define RESET_NONE (0UL)
@ -143,11 +156,13 @@ extern Window desktop_window;
/************ Function Prototypes ************/
_XFUNCPROTOBEGIN
extern const char *get_image_type(unsigned short);
extern unsigned short parse_pixmap_ops(char *);
extern unsigned short set_pixmap_scale(const char *, pixmap_t *);
extern void reset_simage(simage_t *, unsigned long);
extern void paste_simage(simage_t *, Window, unsigned short, unsigned short, unsigned short, unsigned short);
extern void render_simage(simage_t *, Window, unsigned short, unsigned short, int, renderop_t);
extern void redraw_image(unsigned char);
extern void render_simage(simage_t *, Window, unsigned short, unsigned short, unsigned char, renderop_t);
#ifdef USE_POSIX_THREADS
extern void init_bg_pixmap_thread(void *);
#endif

@ -241,6 +241,7 @@ scrollbar_event_init_dispatcher(void)
MEMSET(&scrollbar_event_data, 0, sizeof(event_dispatcher_data_t));
EVENT_DATA_ADD_HANDLER(scrollbar_event_data, ConfigureNotify, sb_handle_configure_notify);
EVENT_DATA_ADD_HANDLER(scrollbar_event_data, EnterNotify, sb_handle_enter_notify);
EVENT_DATA_ADD_HANDLER(scrollbar_event_data, LeaveNotify, sb_handle_leave_notify);
EVENT_DATA_ADD_HANDLER(scrollbar_event_data, FocusIn, sb_handle_focus_in);
@ -265,6 +266,18 @@ scrollbar_event_init_dispatcher(void)
}
unsigned char
sb_handle_configure_notify(event_t * ev)
{
D_EVENTS(("sb_handle_configure_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
REQUIRE_RVAL(XEVENT_IS_PARENT(ev, &scrollbar_event_data), 0);
redraw_image(image_sb);
return 0;
}
unsigned char
sb_handle_enter_notify(event_t * ev)
{
@ -693,19 +706,11 @@ scrollbar_show(short mouseoffset)
gcvalue.foreground = (Xdepth <= 2 ? PixColors[fgColor] : PixColors[scrollColor]);
scrollbarGC = XCreateGC(Xdisplay, scrollBar.win, GCForeground, &gcvalue);
if (scrollbar_is_pixmapped() || (Options & (Opt_scrollBar_floating | Opt_pixmapTrans))) {
render_simage(images[image_sb].current, scrollBar.win, scrollbar_trough_width(), scrollbar_trough_height(), image_sb, 0);
} else if (Options & Opt_scrollBar_floating) {
if (background_is_pixmap()) {
/* FIXME: Extend the bg pixmap into the scrollbar window here? -- mej */
XSetWindowBackground(Xdisplay, scrollBar.win, gcvalue.foreground);
} else {
XSetWindowBackground(Xdisplay, scrollBar.win, PixColors[bgColor]);
}
if ((Options & Opt_scrollBar_floating) && !scrollbar_is_pixmapped() && !background_is_pixmap()) {
XSetWindowBackground(Xdisplay, scrollBar.win, PixColors[bgColor]);
} else {
XSetWindowBackground(Xdisplay, scrollBar.win, gcvalue.foreground);
render_simage(images[image_sb].current, scrollBar.win, scrollbar_trough_width(), scrollbar_trough_height(), image_sb, 0);
}
XClearWindow(Xdisplay, scrollBar.win);
gcvalue.foreground = PixColors[topShadowColor];
topShadowGC = XCreateGC(Xdisplay, scrollBar.win, GCForeground, &gcvalue);
@ -722,7 +727,7 @@ scrollbar_show(short mouseoffset)
focus = TermWin.focus;
gcvalue.foreground = PixColors[focus ? scrollColor : unfocusedScrollColor];
# ifdef PIXMAP_OFFSET
if (!((Options & Opt_pixmapTrans) && (Options & Opt_scrollBar_floating))) {
if (!((Options & Opt_scrollBar_floating) && image_mode_is(image_sb, (MODE_TRANS | MODE_VIEWPORT)))) {
# endif
if (scrollbar_is_pixmapped()) {
XSetWindowBackgroundPixmap(Xdisplay, scrollBar.win, images[image_sb].current->pmap->pixmap);

@ -51,33 +51,33 @@
/* The various scrollbar elements */
#ifdef PIXMAP_SCROLLBAR
# define scrollbar_win_is_scrollbar(w) (scrollbar_visible() && (w) == scrollBar.win)
# define scrollbar_win_is_uparrow(w) ((w) == scrollBar.up_win)
# define scrollbar_win_is_downarrow(w) ((w) == scrollBar.dn_win)
# define scrollbar_win_is_anchor(w) ((w) == scrollBar.sa_win)
# define scrollbar_is_pixmapped() (images[image_sb].current->iml->im)
# define scrollbar_uparrow_is_pixmapped() (images[image_up].current->iml->im)
# define scrollbar_downarrow_is_pixmapped() (images[image_down].current->iml->im)
# define scrollbar_anchor_is_pixmapped() (images[image_sa].current->iml->im)
# define scrollbar_upButton(w, y) ( scrollbar_uparrow_is_pixmapped() ? scrollbar_win_is_uparrow(w) \
: ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg)))
# define scrollbar_dnButton(w, y) ( scrollbar_downarrow_is_pixmapped() ? scrollbar_win_is_downarrow(w) \
: ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end)))
# define scrollbar_win_is_scrollbar(w) (scrollbar_visible() && (w) == scrollBar.win)
# define scrollbar_win_is_uparrow(w) ((w) == scrollBar.up_win)
# define scrollbar_win_is_downarrow(w) ((w) == scrollBar.dn_win)
# define scrollbar_win_is_anchor(w) ((w) == scrollBar.sa_win)
# define scrollbar_is_pixmapped() ((images[image_sb].current->iml->im) && (images[image_sb].mode & MODE_MASK))
# define scrollbar_uparrow_is_pixmapped() ((images[image_up].current->iml->im) && (images[image_up].mode & MODE_MASK))
# define scrollbar_downarrow_is_pixmapped() ((images[image_down].current->iml->im) && (images[image_down].mode & MODE_MASK))
# define scrollbar_anchor_is_pixmapped() ((images[image_sa].current->iml->im) && (images[image_sa].mode & MODE_MASK))
# define scrollbar_upButton(w, y) ( scrollbar_uparrow_is_pixmapped() ? scrollbar_win_is_uparrow(w) \
: ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg)))
# define scrollbar_dnButton(w, y) ( scrollbar_downarrow_is_pixmapped() ? scrollbar_win_is_downarrow(w) \
: ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end)))
#else
# define scrollbar_win_is_scrollbar(w) (scrollbar_visible() && (w) == scrollBar.win)
# define scrollbar_win_is_uparrow(w) (0)
# define scrollbar_win_is_downarrow(w) (0)
# define scrollbar_win_is_anchor(w) (0)
# define scrollbar_is_pixmapped() (0)
# define scrollbar_uparrow_is_pixmapped() (0)
# define scrollbar_win_is_scrollbar(w) (scrollbar_visible() && (w) == scrollBar.win)
# define scrollbar_win_is_uparrow(w) (0)
# define scrollbar_win_is_downarrow(w) (0)
# define scrollbar_win_is_anchor(w) (0)
# define scrollbar_is_pixmapped() (0)
# define scrollbar_uparrow_is_pixmapped() (0)
# define scrollbar_downarrow_is_pixmapped() (0)
# define scrollbar_anchor_is_pixmapped() (0)
# define scrollbar_upButton(w, y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg))
# define scrollbar_dnButton(w, y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end))
# define scrollbar_anchor_is_pixmapped() (0)
# define scrollbar_upButton(w, y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg))
# define scrollbar_dnButton(w, y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end))
#endif
/* Scrollbar dimensions */
@ -142,6 +142,7 @@ extern void Draw_up_button(int, int, int);
extern void Draw_dn_button(int, int, int);
extern void scrollbar_init(void);
extern void scrollbar_event_init_dispatcher(void);
extern unsigned char sb_handle_configure_notify(event_t *);
extern unsigned char sb_handle_enter_notify(event_t *);
extern unsigned char sb_handle_leave_notify(event_t *);
extern unsigned char sb_handle_focus_in(event_t *);

@ -937,7 +937,7 @@ process_csi_seq(void)
break;
case 9:
#ifdef PIXMAP_OFFSET
if (Options & Opt_pixmapTrans) {
if (image_mode_is(image_bg, MODE_TRANS)) {
char tbuff[70];
char shading = 0;
unsigned long tint = 0xffffff;
@ -1629,7 +1629,7 @@ xterm_seq(int op, const char *str)
XColor xcol;
char *nstr, *tnstr, *orig_tnstr;
unsigned char eterm_seq_op;
unsigned char eterm_seq_op, which = 0;
#ifdef PIXMAP_SUPPORT
unsigned char changed = 0, scaled = 0;
char *color, *mod, *valptr;
@ -1645,6 +1645,9 @@ xterm_seq(int op, const char *str)
switch (op) {
case XTerm_title:
set_title(str);
break;
case XTerm_prop:
break;
case XTerm_name:
set_title(str); /* drop */
@ -1686,10 +1689,10 @@ xterm_seq(int op, const char *str)
may not be needed.
*/
D_EVENTS(("Got XTerm_EtermSeq sequence\n"));
D_CMD(("Got XTerm_EtermSeq sequence\n"));
nstr = strsep(&tnstr, ";");
eterm_seq_op = (unsigned char) strtol(nstr, (char **) NULL, 10);
D_EVENTS((" XTerm_EtermSeq operation is %d\n", eterm_seq_op));
D_CMD((" XTerm_EtermSeq operation is %d\n", eterm_seq_op));
/* Yes, there is order to the numbers for this stuff. And here it is:
0-9 Transparency Configuration
10-14 Scrollbar Configuration
@ -1704,40 +1707,72 @@ xterm_seq(int op, const char *str)
#ifdef PIXMAP_OFFSET
case 0:
nstr = strsep(&tnstr, ";");
OPT_SET_OR_TOGGLE_NEG(nstr, Options, Opt_pixmapTrans);
if (Options & Opt_pixmapTrans) {
Options &= ~(Opt_pixmapTrans);
} else {
Options |= Opt_pixmapTrans;
if (images[image_bg].current->pmap->pixmap != None) {
Imlib_free_pixmap(imlib_id, images[image_bg].current->pmap->pixmap);
}
images[image_bg].current->pmap->pixmap = None;
}
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
render_simage(images[image_sb].current, scrollBar.win, scrollbar_trough_width(), scrollbar_trough_height(), image_sb, 0);
scrollbar_show(0);
if (nstr) {
if (BOOL_OPT_ISTRUE(nstr)) {
D_CMD((" Request to enable transparency.\n"));
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); \
} \
images[idx].current->pmap->pixmap = None; \
});
} else if (BOOL_OPT_ISFALSE(nstr)) {
D_CMD((" Request to disable transparency.\n"));
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {if (image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);} else {image_set_mode(idx, MODE_SOLID);}});
} else {
D_CMD((" Bad boolean value in transparency request.\n"));
break;
}
} else {
D_CMD((" Request to toggle transparency.\n"));
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); \
} \
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);} else {image_set_mode(idx, MODE_SOLID);}});
}
redraw_all_images();
break;
case 1:
color = strsep(&tnstr, ";");
if (!color) {
if ((color = strsep(&tnstr, ";")) == NULL) {
break;
}
mod = strsep(&tnstr, ";");
if (!mod) {
if ((strlen(color) == 2) || (!strcasecmp(color, "down"))) {
/* They specified an image index */
if (!strcasecmp(color, "bg")) {
which = image_bg;
} else if (!strcasecmp(color, "sb")) {
which = image_sb;
} else if (!strcasecmp(color, "sa")) {
which = image_sa;
} else if (!strcasecmp(color, "up")) {
which = image_up;
} else if (!strcasecmp(color, "down")) {
which = image_down;
} else {
break;
}
if ((color = strsep(&tnstr, ";")) == NULL) {
break;
}
} else {
which = image_bg;
}
if ((mod = strsep(&tnstr, ";")) == NULL) {
break;
}
valptr = strsep(&tnstr, ";");
if (!valptr) {
if ((valptr = strsep(&tnstr, ";")) == NULL) {
break;
}
D_EVENTS(("Modifying the %s attribute of the %s color modifier to be %s\n", mod, color, valptr));
if (Options & Opt_pixmapTrans && desktop_pixmap != None) {
D_CMD(("Modifying the %s attribute of the %s color modifier of the %s image to be %s\n", mod, color, get_image_type(which), valptr));
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
free_desktop_pixmap();
desktop_pixmap = None; /* Force the re-read */
}
if (Options & Opt_viewport_mode && viewport_pixmap != None) {
if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
XFreePixmap(Xdisplay, viewport_pixmap);
viewport_pixmap = None; /* Force the re-read */
}
@ -1801,19 +1836,18 @@ xterm_seq(int op, const char *str)
iml->bmod->gamma = (int) strtol(valptr, (char **) NULL, 0);
}
}
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
redraw_all_images();
break;
case 3:
if (Options & Opt_pixmapTrans) {
get_desktop_window();
if (desktop_pixmap != None) {
free_desktop_pixmap();
}
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
}
if (desktop_pixmap != None) {
free_desktop_pixmap();
}
get_desktop_window();
if (desktop_window == None) {
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {image_set_mode(idx, MODE_IMAGE); image_allow_mode(idx, ALLOW_IMAGE);});
break;
}
redraw_all_images();
break;
#endif
case 10:
@ -1898,9 +1932,8 @@ xterm_seq(int op, const char *str)
break;
case 24:
nstr = strsep(&tnstr, ";");
OPT_SET_OR_TOGGLE(nstr, Options, Opt_viewport_mode);
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_VIEWPORT) && image_mode_is(idx, ALLOW_VIEWPORT)) {image_set_mode(idx, MODE_VIEWPORT);});
redraw_all_images();
break;
case 25:
nstr = strsep(&tnstr, ";");
@ -1972,11 +2005,7 @@ xterm_seq(int op, const char *str)
case XTerm_Pixmap:
#ifdef PIXMAP_SUPPORT
# ifdef PIXMAP_OFFSET
if (Options & Opt_pixmapTrans) {
Options &= ~(Opt_pixmapTrans);
}
# endif
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_IMAGE) && image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);});
if (!strcmp(str, ";")) {
load_image("", image_bg);
bg_needs_update = 1;
@ -1998,8 +2027,7 @@ xterm_seq(int op, const char *str)
}
}
if ((changed) || (bg_needs_update)) {
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
scr_touch();
redraw_image(image_bg);
}
#endif /* PIXMAP_SUPPORT */
break;

@ -64,6 +64,7 @@
# define XTerm_name 0
# define XTerm_iconName 1
# define XTerm_title 2
# define XTerm_prop 3
# define XTerm_logfile 46
# define XTerm_font 50

@ -151,8 +151,8 @@ Create_Windows(int argc, char *argv[])
XWMHints wmHint;
Atom prop = None;
CARD32 val;
int i, x, y, flags;
unsigned int width, height;
int i, x = 0, y = 0, flags;
unsigned int width = 0, height = 0;
unsigned int r, g, b;
MWMHints mwmhints;
@ -348,7 +348,9 @@ Create_Windows(int argc, char *argv[])
szHint.y = y;
szHint.flags |= USPosition;
}
D_X11(("Geometry values after parsing: %dx%d%+d%+d\n", width, height, x, y));
if (flags) {
D_X11(("Geometry values after parsing: %dx%d%+d%+d\n", width, height, x, y));
}
/* parent window - reverse video so we can see placement errors
* sub-window placement & size in resize_subwindows()
@ -498,11 +500,9 @@ resize_subwindows(int width, int height)
}
#endif
width -= scrollbar_trough_width();
XMoveResizeWindow(Xdisplay, scrollBar.win,
((Options & Opt_scrollBar_right) ? (width) : (x)),
0, scrollbar_trough_width(), height);
XMoveResizeWindow(Xdisplay, scrollBar.win, ((Options & Opt_scrollBar_right) ? (width) : (x)), 0, scrollbar_trough_width(), height);
if (scrollbar_is_pixmapped()) {
render_simage(images[image_sb].current, scrollBar.win, scrollbar_trough_width(), scrollbar_trough_height(), image_sb, 0);
scrollbar_show(0);
}
if (!(Options & Opt_scrollBar_right)) {
x = scrollbar_trough_width();
@ -514,40 +514,14 @@ resize_subwindows(int width, int height)
if (old_width)
Gr_Resize(old_width, old_height);
#endif
XClearWindow(Xdisplay, TermWin.vt);
if (!(background_is_pixmap()))
if (!(background_is_pixmap())) {
XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[bgColor]);
#ifdef PIXMAP_SUPPORT
# ifdef USE_POSIX_THREADS
D_PIXMAP(("resize_subwindows(): start_bg_thread()\n"));
pthread_attr_init(&resize_sub_thr_attr);
# ifdef MUTEX_SYNCH
if (pthread_mutex_trylock(&mutex) == EBUSY) {
D_THREADS(("resize_subwindows(): mutex locked, bbl\n"));
XClearWindow(Xdisplay, TermWin.vt);
} else {
D_THREADS(("pthread_mutex_trylock(&mutex): "));
pthread_mutex_unlock(&mutex);
D_THREADS(("pthread_mutex_unlock(&mutex)\n"));
}
# endif
if (!(pthread_create(&resize_sub_thr, &resize_sub_thr_attr,
(void *) &render_bg_thread, NULL))) {
/* bg_set = 0; */
D_THREADS(("thread created\n"));
} else {
D_THREADS(("pthread_create() failed!\n"));
}
# else
D_PIXMAP(("resize_subwindows(): render_pixmap(TermWin.vt)\n"));
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
XSync(Xdisplay, 0);
# endif
#ifdef PIXMAP_SUPPORT
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
#endif
}
}
void
@ -601,11 +575,8 @@ resize_window1(unsigned int width, unsigned int height)
if (curr_screen >= 0) /* this is not the first time thru */
scr_change_screen(curr_screen);
first_time = 0;
} else if (((Options & Opt_pixmapTrans) || (images[image_bg].mode & MODE_TRANS))
|| ((Options & Opt_viewport_mode) || (images[image_bg].mode & MODE_VIEWPORT))) {
} else if (image_mode_is(image_bg, MODE_TRANS) || image_mode_is(image_bg, MODE_VIEWPORT)) {
resize_subwindows(width, height);
scrollbar_show(0);
scr_touch();
}
}

@ -44,24 +44,24 @@ begin main
# The colors below are taken from Rasterman's .Xdefaults file. They are intended to
# display ANSI art properly when combined with a good ANSI-art font (like vga or
# Rasterman's nexus font).
# color 0 0 0 0
# color 1 0xaa 0 0
# color 2 0 0210 0
# color 3 0xaa 0x55 0x22
# color 4 0 0 0xaa
# color 5 0xaa 0 0xaa
# color 6 0 0xaa 0xaa
# color 7 0xaa 0xaa 0xaa
# color 8 0x44 0x44 0x44
# color 9 0xff 0x44 0x44
# color 10 0x44 0xff 0x44
# color 11 0xff 0xff 0x44
# color 12 0x44 0x44 0xff
# color 13 0xff 0x44 0xff
# color 14 0x44 0xff 0xff
# color 15 #ffffff
# color bd #ffffff
# color ul #ffffff
color 0 0 0 0
color 1 0xaa 0 0
color 2 0 0210 0
color 3 0xaa 0x55 0x22
color 4 0 0 0xaa
color 5 0xaa 0 0xaa
color 6 0 0xaa 0xaa
color 7 0xaa 0xaa 0xaa
color 8 0x44 0x44 0x44
color 9 0xff 0x44 0x44
color 10 0x44 0xff 0x44
color 11 0xff 0xff 0x44
color 12 0x44 0x44 0xff
color 13 0xff 0x44 0xff
color 14 0x44 0xff 0xff
color 15 #ffffff
color bd #ffffff
color ul #ffffff
# This ends the color section. Any text after the word "end" is
# assumed to be a comment and ignored.
@ -121,7 +121,7 @@ begin main
# The mode line. This defines the startup mode for the image, as well as what modes are allowed.
# Valid modes are "image" (to display the image file), "trans" (to be transparent), or "viewport"
# (for viewport mode). Syntax is "mode <startup_mode> allow <allowed_modes>".
mode image allow trans viewport
mode image allow image trans viewport auto
# Set the image border. This is a portion of the image which will be kept at its actual size when
# scaling. Use this for beveled images (buttons, etc.).
@ -133,7 +133,7 @@ begin main
# The rest of the images.
begin image
type trough
mode image allow trans viewport
mode image allow image trans viewport auto
state normal
file bar_vertical_3.png
# Here is how you specify the geometry string separately. See the man page for its syntax.
@ -142,6 +142,7 @@ begin main
end image
begin image
type anchor
mode image allow image auto
state normal
file bar_vertical_1.png
geom :scale