Tue Oct 22 23:02:28 2002 Michael Jennings (mej)

Allow users to customize the Escreen current/active display colors.

Don't display the Escreen button if there's no Escreen menu defined.


SVN revision: 6432
eterm-0.10
Michael Jennings 20 years ago
parent 862a62b63c
commit d86a345768
  1. 6
      ChangeLog
  2. 11
      src/buttons.c
  3. 7
      src/command.c
  4. 8
      src/options.c
  5. 9
      src/term.c
  6. 12
      src/term.h
  7. 24
      src/windows.c
  8. 2
      src/windows.h
  9. 2
      themes/Escreen/menus.cfg
  10. 5
      themes/Escreen/theme.cfg.in

@ -4875,3 +4875,9 @@ Fixed a double-free in libscream.c. Also some cleanups to the spec
file, and I fixed some missing return statements in non-void
functions.
----------------------------------------------------------------------
Tue Oct 22 23:02:28 2002 Michael Jennings (mej)
Allow users to customize the Escreen current/active display colors.
Don't display the Escreen button if there's no Escreen menu defined.
----------------------------------------------------------------------

@ -803,21 +803,24 @@ button_set_action(button_t *button, action_type_t type, char *action)
switch (type) {
case ACTION_MENU:
button->action.menu = find_menu_by_title(menu_list, action);
return ((button->action.menu == NULL) ? (0) : (1));
break;
case ACTION_STRING:
case ACTION_ECHO:
button->action.string = (char *) MALLOC(strlen(action) + 2);
strcpy(button->action.string, action);
parse_escaped_string(button->action.string);
return ((button->action.string == NULL) ? (0) : (1));
break;
case ACTION_SCRIPT:
button->action.script = (char *) MALLOC(strlen(action) + 2);
strcpy(button->action.script, action);
return ((button->action.script == NULL) ? (0) : (1));
break;
default:
break;
}
return 1;
return 0;
}
void
@ -1095,9 +1098,9 @@ bbar_draw(buttonbar_t *bbar, unsigned char image_state, unsigned char force_mode
int f = button->flags & ~NS_SCREAM_BUTTON;
if (f & NS_SCREAM_CURR) {
f = 1;
f = ES_COLOR_CURRENT;
} else if (f & NS_SCREAM_ACT) {
f = 2;
f = ES_COLOR_ACTIVE;
} else {
f = 0;
}
@ -1108,7 +1111,7 @@ bbar_draw(buttonbar_t *bbar, unsigned char image_state, unsigned char force_mode
gc = LIBAST_X_CREATE_GC(0, NULL);
XCopyGC(Xdisplay, bbar->gc, GCFont, gc);
XSetForeground(Xdisplay, gc, PixColors[minBright + f + 2]);
XSetForeground(Xdisplay, gc, PixColors[f]);
draw_string(bbar, bbar->bg, gc, button->text_x, button->text_y, button->text, button->len);
LIBAST_X_FREE_GC(gc);

@ -2888,9 +2888,10 @@ make_escreen_menu(buttonbar_t *bbar)
#endif
if ((button = button_create(NS_MENU_TITLE))) {
bbar_add_rbutton(bbar, button);
bbar_calc_button_sizes(bbar);
button_set_action(button, ACTION_MENU, NS_MENU_TITLE);
if ((button_set_action(button, ACTION_MENU, NS_MENU_TITLE))) {
bbar_add_rbutton(bbar, button);
bbar_calc_button_sizes(bbar);
}
}
return 1;

@ -825,6 +825,14 @@ parse_color(char *buff, void *state)
} else if (!BEG_STRCASECMP(buff, "pointer ")) {
RESET_AND_ASSIGN(rs_color[pointerColor], get_word(2, buff));
#ifdef ESCREEN
} else if (!BEG_STRCASECMP(buff, "es_current ")) {
RESET_AND_ASSIGN(rs_color[ES_COLOR_CURRENT], get_word(2, buff));
} else if (!BEG_STRCASECMP(buff, "es_active ")) {
RESET_AND_ASSIGN(rs_color[ES_COLOR_ACTIVE], get_word(2, buff));
#endif
} else if (!BEG_STRCASECMP(buff, "video ")) {
char *tmp = get_pword(2, buff);

@ -82,13 +82,16 @@ char *def_colorName[] = {
#ifndef NO_CURSORCOLOR
NULL, NULL, /* cursorColor, cursorColor2 */
#endif /* NO_CURSORCOLOR */
NULL, NULL /* pointerColor, borderColor */
#ifndef NO_BOLDUNDERLINE
, NULL, NULL /* colorBD, colorUL */
NULL, NULL, /* colorBD, colorUL */
#endif /* NO_BOLDUNDERLINE */
#ifdef ESCREEN
NULL, NULL, /* ES_COLOR_CURRENT, ES_COLOR_ACTIVE */
#endif
NULL, NULL /* pointerColor, borderColor */
};
char *rs_color[NRS_COLORS];
Pixel PixColors[NRS_COLORS + NSHADOWCOLORS];
Pixel PixColors[NRS_COLORS + EXTRA_COLORS];
unsigned int MetaMask = 0, AltMask = 0, NumLockMask = 0;
unsigned int modmasks[] = { Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask };

@ -109,12 +109,16 @@ enum color_list {
cursorColor,
cursorColor2,
# endif
pointerColor,
borderColor,
# ifndef NO_BOLDUNDERLINE
colorBD,
colorUL,
# endif
#ifdef ESCREEN
ES_COLOR_CURRENT,
ES_COLOR_ACTIVE,
#endif
pointerColor,
borderColor,
NRS_COLORS, /* */
topShadowColor = NRS_COLORS,
bottomShadowColor,
@ -127,7 +131,7 @@ enum color_list {
TOTAL_COLORS /* */
};
# define NSHADOWCOLORS (TOTAL_COLORS - NRS_COLORS)
# define EXTRA_COLORS (TOTAL_COLORS - NRS_COLORS)
#ifdef HOTKEY_CTRL
# define HOTKEY ctrl
@ -152,7 +156,7 @@ extern unsigned long PrivateModes;
extern unsigned long SavedModes;
extern char *def_colorName[];
extern char *rs_color[NRS_COLORS];
extern Pixel PixColors[NRS_COLORS + NSHADOWCOLORS];
extern Pixel PixColors[NRS_COLORS + EXTRA_COLORS];
extern unsigned int MetaMask, AltMask, NumLockMask;
extern unsigned int modmasks[];

@ -261,7 +261,7 @@ process_colors(void)
Pixel pixel;
for (i = 0; i < NRS_COLORS; i++) {
if ((Xdepth <= 2) || ((pixel = get_color_by_name(rs_color[i], def_colorName[i])) == (Pixel) - 1)) {
if ((Xdepth <= 2) || ((pixel = get_color_by_name(rs_color[i], def_colorName[i])) == (Pixel) (-1))) {
switch (i) {
case fgColor:
pixel = WhitePixel(Xdisplay, Xscreen);
@ -277,12 +277,6 @@ process_colors(void)
pixel = PixColors[fgColor];
break;
#endif /* NO_CURSORCOLOR */
case pointerColor:
pixel = PixColors[fgColor];
break;
case borderColor:
pixel = PixColors[bgColor];
break;
#ifndef NO_BOLDUNDERLINE
case colorBD:
pixel = PixColors[fgColor];
@ -291,6 +285,20 @@ process_colors(void)
pixel = PixColors[fgColor];
break;
#endif
#ifdef ESCREEN
case ES_COLOR_CURRENT:
pixel = PixColors[YellowColor];
break;
case ES_COLOR_ACTIVE:
pixel = PixColors[BlueColor];
break;
#endif
case pointerColor:
pixel = PixColors[fgColor];
break;
case borderColor:
pixel = PixColors[bgColor];
break;
default:
pixel = PixColors[fgColor]; /* None */
break;
@ -641,7 +649,7 @@ handle_move(int x, int y)
void
stored_palette(char op)
{
static Pixel default_colors[NRS_COLORS + NSHADOWCOLORS];
static Pixel default_colors[NRS_COLORS + EXTRA_COLORS];
static unsigned char stored = 0;
unsigned char i;

@ -31,7 +31,7 @@
/************ Variables ************/
extern char *rs_color[NRS_COLORS];
extern Pixel PixColors[NRS_COLORS + NSHADOWCOLORS];
extern Pixel PixColors[NRS_COLORS + EXTRA_COLORS];
extern XSetWindowAttributes Attributes;
extern XWindowAttributes attr;
extern XSizeHints szHint;

@ -0,0 +1,2 @@
<Eterm-0.9.2>
# This file is intentionally blank. :-)

@ -3,6 +3,11 @@
%include "../Eterm/menus.cfg"
%include "../Eterm/theme.cfg"
begin color
es_current "#ffff00"
es_active "#0000ff"
end color
begin attributes
name "%appname() -- Escreen Session"
end attributes

Loading…
Cancel
Save