Mon Sep 20 21:25:46 PDT 1999 Michael Jennings <mej@eterm.org>

Added support for xterm's property change escape sequence as requested
	by Greg Badros <gjb@cs.washington.edu>, the originator of the
	sequence.


SVN revision: 353
This commit is contained in:
Michael Jennings 1999-09-21 04:09:53 +00:00
parent 23ae8eb96f
commit bbb476846f
4 changed files with 41 additions and 3 deletions

View File

@ -2440,3 +2440,10 @@ Mon Sep 20 21:00:46 PDT 1999 Michael Jennings <mej@eterm.org>
background image. background image.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Mon Sep 20 21:25:46 PDT 1999 Michael Jennings <mej@eterm.org>
Added support for xterm's property change escape sequence as requested
by Greg Badros <gjb@cs.washington.edu>, the originator of the
sequence.
-------------------------------------------------------------------------------

View File

@ -1628,11 +1628,11 @@ xterm_seq(int op, const char *str)
{ {
XColor xcol; XColor xcol;
char *nstr, *tnstr, *orig_tnstr; char *nstr, *tnstr, *orig_tnstr, *valptr;
unsigned char eterm_seq_op, which = 0; unsigned char eterm_seq_op, which = 0;
#ifdef PIXMAP_SUPPORT #ifdef PIXMAP_SUPPORT
unsigned char changed = 0, scaled = 0; unsigned char changed = 0, scaled = 0;
char *color, *mod, *valptr; char *color, *mod;
#endif #endif
if (!str) if (!str)
@ -1647,7 +1647,13 @@ xterm_seq(int op, const char *str)
set_title(str); set_title(str);
break; break;
case XTerm_prop: case XTerm_prop:
if ((nstr = strsep(&tnstr, ";")) == NULL) {
break;
}
if ((valptr = strchr(nstr, '=')) != NULL) {
*(valptr++) = 0;
}
set_text_property(TermWin.parent, nstr, valptr);
break; break;
case XTerm_name: case XTerm_name:
set_title(str); /* drop */ set_title(str); /* drop */

View File

@ -78,6 +78,30 @@ const char *def_fontName[] =
}; };
Cursor TermWin_cursor; /* cursor for vt window */ Cursor TermWin_cursor; /* cursor for vt window */
void
set_text_property(Window win, char *propname, char *value)
{
XTextProperty prop;
Atom atom;
ASSERT(propname != NULL);
if (value == NULL) {
atom = XInternAtom(Xdisplay, propname, True);
if (atom == None) {
return;
}
XDeleteProperty(Xdisplay, win, atom);
} else {
atom = XInternAtom(Xdisplay, propname, False);
prop.value = value;
prop.encoding = XA_STRING;
prop.format = 8;
prop.nitems = strlen(value);
XSetTextProperty(Xdisplay, win, &prop, atom);
}
}
Pixel Pixel
get_bottom_shadow_color(Pixel norm_color, const char *type) get_bottom_shadow_color(Pixel norm_color, const char *type)
{ {

View File

@ -62,6 +62,7 @@ extern const char *rs_mfont[NFONTS];
/************ Function Prototypes ************/ /************ Function Prototypes ************/
_XFUNCPROTOBEGIN _XFUNCPROTOBEGIN
extern void set_text_property(Window, char *, char *);
extern Pixel get_bottom_shadow_color(Pixel, const char *); extern Pixel get_bottom_shadow_color(Pixel, const char *);
extern Pixel get_top_shadow_color(Pixel, const char *); extern Pixel get_top_shadow_color(Pixel, const char *);
extern void Create_Windows(int, char * []); extern void Create_Windows(int, char * []);