Fri Nov 19 16:55:22 PST 1999 Michael Jennings <mej@eterm.org>
Okay, I think I have everything back in working order. PLEASE test this thoroughly, as an awful lot has changed. Let me know what I broke. :) SVN revision: 1339
This commit is contained in:
parent
c6e3fdbac9
commit
eec575c1e3
|
@ -2807,3 +2807,10 @@ Thu Nov 18 21:47:02 PST 1999 Michael Jennings <mej@eterm.org>
|
|||
efficient than before.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Fri Nov 19 16:55:22 PST 1999 Michael Jennings <mej@eterm.org>
|
||||
|
||||
Okay, I think I have everything back in working order. PLEASE test
|
||||
this thoroughly, as an awful lot has changed. Let me know what I
|
||||
broke. :)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
|
@ -158,7 +158,8 @@ static char *v_bufend; /* end of physical buffer */
|
|||
static Atom DndProtocol, DndSelection;
|
||||
#endif /* OFFIX_DND */
|
||||
#ifdef USE_XIM
|
||||
XIC Input_Context = NULL; /* input context */
|
||||
XIC xim_input_context = NULL; /* input context */
|
||||
static XIMStyle xim_input_style = 0;
|
||||
#endif
|
||||
|
||||
/* Substitutes for missing system functions */
|
||||
|
@ -1745,21 +1746,23 @@ static void
|
|||
xim_send_spot(void)
|
||||
{
|
||||
XPoint spot;
|
||||
static XPoint oldSpot = { -1, -1 };
|
||||
XVaNestedList preedit_attr;
|
||||
XIMStyle input_style;
|
||||
|
||||
if (Input_Context == NULL) {
|
||||
if (xim_input_context == NULL) {
|
||||
return;
|
||||
} else {
|
||||
XGetICValues(Input_Context, XNInputStyle, &input_style, NULL);
|
||||
if (!(input_style & XIMPreeditPosition)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (xim_input_style & XIMPreeditPosition) {
|
||||
xim_get_position(&spot);
|
||||
if (spot.x != oldSpot.x || spot.y != oldSpot.y) {
|
||||
oldSpot.x = spot.x;
|
||||
oldSpot.y = spot.y;
|
||||
preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
|
||||
XSetICValues(xim_input_context, XNPreeditAttributes, preedit_attr, NULL);
|
||||
XFree(preedit_attr);
|
||||
}
|
||||
}
|
||||
xim_get_position(&spot);
|
||||
preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
|
||||
XSetICValues(Input_Context, XNPreeditAttributes, preedit_attr, NULL);
|
||||
XFree(preedit_attr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1783,7 +1786,7 @@ xim_get_area(XRectangle *preedit_rect, XRectangle *status_rect,
|
|||
static void
|
||||
xim_destroy_cb(XIM xim, XPointer client_data, XPointer call_data)
|
||||
{
|
||||
Input_Context = NULL;
|
||||
xim_input_context = NULL;
|
||||
XRegisterIMInstantiateCallback(Xdisplay, NULL, NULL, NULL, xim_instantiate_cb, NULL);
|
||||
xim = NULL;
|
||||
client_data = call_data = (XPointer) 0;
|
||||
|
@ -1793,7 +1796,7 @@ static void
|
|||
xim_instantiate_cb(Display *display, XPointer client_data, XPointer call_data)
|
||||
{
|
||||
xim_real_init();
|
||||
if (Input_Context) {
|
||||
if (xim_input_context) {
|
||||
XUnregisterIMInstantiateCallback(Xdisplay, NULL, NULL, NULL, xim_instantiate_cb, NULL);
|
||||
}
|
||||
display = NULL;
|
||||
|
@ -1807,7 +1810,6 @@ xim_real_init(void)
|
|||
char *p, *s, buf[64], tmp[1024];
|
||||
char *end, *next_s;
|
||||
XIM xim = NULL;
|
||||
XIMStyle input_style = 0;
|
||||
XIMStyles *xim_styles = NULL;
|
||||
int found;
|
||||
XPoint spot;
|
||||
|
@ -1816,7 +1818,9 @@ xim_real_init(void)
|
|||
XVaNestedList preedit_attr = NULL;
|
||||
XVaNestedList status_attr = NULL;
|
||||
|
||||
REQUIRE_RVAL(Input_Context == NULL, -1);
|
||||
REQUIRE_RVAL(xim_input_context == NULL, -1);
|
||||
|
||||
xim_input_style = 0;
|
||||
|
||||
if (rs_input_method && *rs_input_method) {
|
||||
strncpy(tmp, rs_input_method, sizeof(tmp) - 1);
|
||||
|
@ -1890,15 +1894,15 @@ xim_real_init(void)
|
|||
*(end + 1) = '\0';
|
||||
|
||||
if (!strcmp(s, "OverTheSpot")) {
|
||||
input_style = (XIMPreeditPosition | XIMStatusNothing);
|
||||
xim_input_style = (XIMPreeditPosition | XIMStatusNothing);
|
||||
} else if (!strcmp(s, "OffTheSpot")) {
|
||||
input_style = (XIMPreeditArea | XIMStatusArea);
|
||||
xim_input_style = (XIMPreeditArea | XIMStatusArea);
|
||||
} else if (!strcmp(s, "Root")) {
|
||||
input_style = (XIMPreeditNothing | XIMStatusNothing);
|
||||
xim_input_style = (XIMPreeditNothing | XIMStatusNothing);
|
||||
}
|
||||
|
||||
for (i = 0; i < xim_styles->count_styles; i++) {
|
||||
if (input_style == xim_styles->supported_styles[i]) {
|
||||
if (xim_input_style == xim_styles->supported_styles[i]) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
@ -1911,18 +1915,19 @@ xim_real_init(void)
|
|||
XCloseIM(xim);
|
||||
return -1;
|
||||
}
|
||||
if ((input_style != (XIMPreeditNothing | XIMStatusNothing)) && (input_style != (XIMPreeditArea | XIMStatusArea))
|
||||
&& (input_style != (XIMPreeditPosition | XIMStatusNothing))) {
|
||||
if ((xim_input_style != (XIMPreeditNothing | XIMStatusNothing))
|
||||
&& (xim_input_style != (XIMPreeditArea | XIMStatusArea))
|
||||
&& (xim_input_style != (XIMPreeditPosition | XIMStatusNothing))) {
|
||||
print_error("This program does not support the preedit type");
|
||||
XCloseIM(xim);
|
||||
return -1;
|
||||
}
|
||||
if (input_style & XIMPreeditPosition) {
|
||||
if (xim_input_style & XIMPreeditPosition) {
|
||||
xim_set_size(&rect);
|
||||
xim_get_position(&spot);
|
||||
xim_set_color(&fg, &bg);
|
||||
preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNSpotLocation, &spot, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL);
|
||||
} else if (input_style & XIMPreeditArea) {
|
||||
} else if (xim_input_style & XIMPreeditArea) {
|
||||
xim_set_color(&fg, &bg);
|
||||
/* The necessary width of preedit area is unknown until create input context. */
|
||||
needed_rect.width = 0;
|
||||
|
@ -1930,16 +1935,16 @@ xim_real_init(void)
|
|||
preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL);
|
||||
status_attr = XVaCreateNestedList(0, XNArea, &status_rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL);
|
||||
}
|
||||
Input_Context = XCreateIC(xim, XNInputStyle, input_style, XNClientWindow, TermWin.parent, XNFocusWindow, TermWin.parent,
|
||||
xim_input_context = XCreateIC(xim, XNInputStyle, xim_input_style, XNClientWindow, TermWin.parent, XNFocusWindow, TermWin.parent,
|
||||
preedit_attr ? XNPreeditAttributes : NULL, preedit_attr, status_attr ? XNStatusAttributes : NULL, status_attr, NULL);
|
||||
XFree(preedit_attr);
|
||||
XFree(status_attr);
|
||||
if (Input_Context == NULL) {
|
||||
if (xim_input_context == NULL) {
|
||||
print_error("Failed to create input context");
|
||||
XCloseIM(xim);
|
||||
return -1;
|
||||
}
|
||||
if (input_style & XIMPreeditArea)
|
||||
if (xim_input_style & XIMPreeditArea)
|
||||
xim_set_status_position();
|
||||
return 0;
|
||||
}
|
||||
|
@ -1947,25 +1952,22 @@ xim_real_init(void)
|
|||
void
|
||||
xim_set_status_position(void)
|
||||
{
|
||||
XIMStyle input_style;
|
||||
XRectangle preedit_rect, status_rect, *needed_rect;
|
||||
XVaNestedList preedit_attr, status_attr;
|
||||
|
||||
REQUIRE(Input_Context != NULL);
|
||||
REQUIRE(xim_input_context != NULL);
|
||||
|
||||
XGetICValues(Input_Context, XNInputStyle, &input_style, NULL);
|
||||
|
||||
if (input_style & XIMPreeditArea) {
|
||||
if (xim_input_style & XIMPreeditArea) {
|
||||
/* Getting the necessary width of preedit area */
|
||||
status_attr = XVaCreateNestedList(0, XNAreaNeeded, &needed_rect, NULL);
|
||||
XGetICValues(Input_Context, XNStatusAttributes, status_attr, NULL);
|
||||
XGetICValues(xim_input_context, XNStatusAttributes, status_attr, NULL);
|
||||
XFree(status_attr);
|
||||
|
||||
xim_get_area(&preedit_rect, &status_rect, needed_rect);
|
||||
|
||||
preedit_attr = XVaCreateNestedList(0, XNArea, &preedit_rect, NULL);
|
||||
status_attr = XVaCreateNestedList(0, XNArea, &status_rect, NULL);
|
||||
XSetICValues(Input_Context, XNPreeditAttributes, preedit_attr, XNStatusAttributes, status_attr, NULL);
|
||||
XSetICValues(xim_input_context, XNPreeditAttributes, preedit_attr, XNStatusAttributes, status_attr, NULL);
|
||||
XFree(preedit_attr);
|
||||
XFree(status_attr);
|
||||
}
|
||||
|
@ -1973,18 +1975,15 @@ xim_set_status_position(void)
|
|||
|
||||
void xim_set_fontset(void)
|
||||
{
|
||||
XIMStyle input_style;
|
||||
XVaNestedList preedit_attr;
|
||||
XVaNestedList status_attr;
|
||||
|
||||
REQUIRE(Input_Context != NULL);
|
||||
REQUIRE(xim_input_context != NULL);
|
||||
|
||||
XGetICValues(Input_Context, XNInputStyle, &input_style, NULL);
|
||||
|
||||
if (input_style & (XIMPreeditArea | XIMPreeditPosition)) {
|
||||
if (xim_input_style & (XIMPreeditArea | XIMPreeditPosition)) {
|
||||
preedit_attr = XVaCreateNestedList(0, XNFontSet, TermWin.fontset, NULL);
|
||||
status_attr = XVaCreateNestedList(0, XNFontSet, TermWin.fontset, NULL);
|
||||
XSetICValues(Input_Context, XNPreeditAttributes, preedit_attr, XNStatusAttributes, status_attr, NULL);
|
||||
XSetICValues(xim_input_context, XNPreeditAttributes, preedit_attr, XNStatusAttributes, status_attr, NULL);
|
||||
XFree(preedit_attr);
|
||||
XFree(status_attr);
|
||||
}
|
||||
|
@ -2407,7 +2406,7 @@ cmd_getc(void)
|
|||
XNextEvent(Xdisplay, &ev);
|
||||
|
||||
#ifdef USE_XIM
|
||||
if (Input_Context != NULL) {
|
||||
if (xim_input_context != NULL) {
|
||||
if (!XFilterEvent(&ev, ev.xkey.window)) {
|
||||
event_dispatch(&ev);
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ extern unsigned long PrivateModes;
|
|||
extern Atom wmDeleteWindow;
|
||||
extern int refresh_count, refresh_limit, refresh_type;
|
||||
#ifdef USE_XIM
|
||||
extern XIC Input_Context; /* input context */
|
||||
extern XIC xim_input_context; /* input context */
|
||||
#endif
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
|
|
|
@ -389,8 +389,8 @@ handle_focus_in(event_t * ev)
|
|||
map_scrollbar(Options & Opt_scrollbar);
|
||||
}
|
||||
#ifdef USE_XIM
|
||||
if (Input_Context != NULL)
|
||||
XSetICFocus(Input_Context);
|
||||
if (xim_input_context != NULL)
|
||||
XSetICFocus(xim_input_context);
|
||||
#endif
|
||||
}
|
||||
return 1;
|
||||
|
@ -413,8 +413,8 @@ handle_focus_out(event_t * ev)
|
|||
map_scrollbar(0);
|
||||
}
|
||||
#ifdef USE_XIM
|
||||
if (Input_Context != NULL)
|
||||
XUnsetICFocus(Input_Context);
|
||||
if (xim_input_context != NULL)
|
||||
XUnsetICFocus(xim_input_context);
|
||||
#endif
|
||||
}
|
||||
return 1;
|
||||
|
|
|
@ -328,7 +328,7 @@ change_font(int init, const char *fontname)
|
|||
TermWin.mfont = load_font(rs_mfont[idx], "k14", FONT_TYPE_X);
|
||||
}
|
||||
# ifdef USE_XIM
|
||||
if (Input_Context) {
|
||||
if (xim_input_context) {
|
||||
if (TermWin.fontset) {
|
||||
XFreeFontSet(Xdisplay, TermWin.fontset);
|
||||
}
|
||||
|
|
|
@ -42,8 +42,6 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include "term.h"
|
||||
#include "windows.h"
|
||||
|
||||
#error This code is broken. Try back tomorrow.
|
||||
|
||||
event_dispatcher_data_t scrollbar_event_data;
|
||||
scrollbar_t scrollbar = {
|
||||
None, None, None, None,
|
||||
|
@ -63,7 +61,7 @@ short scroll_arrow_delay;
|
|||
static GC gc_scrollbar;
|
||||
static short last_top = 0, last_bot = 0;
|
||||
#ifdef XTERM_SCROLLBAR
|
||||
static GC gc_stipple;
|
||||
static GC gc_stipple, gc_border;
|
||||
static unsigned char xterm_sb_bits[] = {0xaa, 0x0a, 0x55, 0x05}; /* 12x2 bitmap */
|
||||
#endif
|
||||
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
||||
|
@ -239,6 +237,7 @@ sb_handle_button_press(event_t * ev)
|
|||
}
|
||||
} else {
|
||||
if (scrollbar_win_is_anchor(ev->xany.window)) {
|
||||
scrollbar_set_anchor_pressed(1);
|
||||
scrollbar_draw_anchor(IMAGE_STATE_CLICKED, 0);
|
||||
}
|
||||
switch (ev->xbutton.button) {
|
||||
|
@ -266,7 +265,6 @@ sb_handle_button_press(event_t * ev)
|
|||
scrollbar_draw_trough(IMAGE_STATE_CLICKED, 0);
|
||||
scr_page(DN, TermWin.nrow - 1);
|
||||
} else {
|
||||
scrollbar_draw_anchor(IMAGE_STATE_CLICKED, 0);
|
||||
scrollbar_set_motion(1);
|
||||
}
|
||||
}
|
||||
|
@ -300,6 +298,7 @@ sb_handle_button_release(event_t * ev)
|
|||
button_state.report_mode = (button_state.bypass_keystate ? 0 : ((PrivateModes & PrivMode_mouse_report) ? 1 : 0));
|
||||
|
||||
XQueryPointer(Xdisplay, scrollbar_get_win(), &root, &child, &root_x, &root_y, &win_x, &win_y, &mask);
|
||||
scrollbar_cancel_motion();
|
||||
if (scrollbar_win_is_uparrow(child)) {
|
||||
scrollbar_draw_uparrow(IMAGE_STATE_SELECTED, 0);
|
||||
} else {
|
||||
|
@ -320,14 +319,6 @@ sb_handle_button_release(event_t * ev)
|
|||
} else {
|
||||
scrollbar_draw_trough(IMAGE_STATE_NORMAL, 0);
|
||||
}
|
||||
if (scrollbar_arrow_is_pressed()) {
|
||||
if (scrollbar_uparrow_is_pressed()) {
|
||||
scrollbar_set_uparrow_pressed(0);
|
||||
} else {
|
||||
scrollbar_set_downarrow_pressed(0);
|
||||
}
|
||||
scrollbar_set_motion(0);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -389,9 +380,11 @@ scrollbar_draw_uparrow(unsigned char image_state, unsigned char force_modes) {
|
|||
if (!image_mode_is(image_up, MODE_MASK)) {
|
||||
/* Solid mode. Redraw every time since it's cheap. */
|
||||
XFillRectangle(Xdisplay, scrollbar.up_win, gc_scrollbar, 0, 0, scrollbar_arrow_width(), scrollbar_arrow_height());
|
||||
if (scrollbar_uparrow_is_pressed()) {
|
||||
if (image_state == IMAGE_STATE_CLICKED) {
|
||||
scrollbar_set_uparrow_pressed(1);
|
||||
draw_uparrow_clicked(scrollbar.up_win, gc_top, gc_bottom, 0, 0, scrollbar_arrow_width() - 1, scrollbar_get_shadow());
|
||||
} else {
|
||||
scrollbar_set_uparrow_pressed(0);
|
||||
draw_uparrow_raised(scrollbar.up_win, gc_top, gc_bottom, 0, 0, scrollbar_arrow_width() - 1, scrollbar_get_shadow());
|
||||
}
|
||||
return;
|
||||
|
@ -444,9 +437,11 @@ scrollbar_draw_downarrow(unsigned char image_state, unsigned char force_modes) {
|
|||
if (!image_mode_is(image_down, MODE_MASK)) {
|
||||
/* Solid mode. Redraw every time since it's cheap. */
|
||||
XFillRectangle(Xdisplay, scrollbar.dn_win, gc_scrollbar, 0, 0, scrollbar_arrow_width(), scrollbar_arrow_height());
|
||||
if (scrollbar_downarrow_is_pressed()) {
|
||||
if (image_state == IMAGE_STATE_CLICKED) {
|
||||
scrollbar_set_downarrow_pressed(1);
|
||||
draw_downarrow_clicked(scrollbar.dn_win, gc_top, gc_bottom, 0, 0, scrollbar_arrow_width() - 1, scrollbar_get_shadow());
|
||||
} else {
|
||||
scrollbar_set_downarrow_pressed(0);
|
||||
draw_downarrow_raised(scrollbar.dn_win, gc_top, gc_bottom, 0, 0, scrollbar_arrow_width() - 1, scrollbar_get_shadow());
|
||||
}
|
||||
return;
|
||||
|
@ -500,13 +495,20 @@ scrollbar_draw_anchor(unsigned char image_state, unsigned char force_modes) {
|
|||
/* Solid mode. Redraw every time since it's cheap. */
|
||||
#ifdef XTERM_SCROLLBAR
|
||||
if (scrollbar.type == SCROLLBAR_XTERM) {
|
||||
XFillRectangle(Xdisplay, scrollbar.sa_win, gc_stipple, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height());
|
||||
int x = ((Options & Opt_scrollbar_right) ? 1 : 0);
|
||||
|
||||
XFillRectangle(Xdisplay, scrollbar.sa_win, gc_stipple, x + 1, 0, scrollbar_anchor_width() - x - 1, scrollbar_anchor_height());
|
||||
XClearWindow(Xdisplay, scrollbar.sa_win);
|
||||
}
|
||||
#endif /* XTERM_SCROLLBAR */
|
||||
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
||||
if (scrollbar.type == SCROLLBAR_MOTIF || scrollbar.type == SCROLLBAR_NEXT) {
|
||||
XFillRectangle(Xdisplay, scrollbar.sa_win, gc_scrollbar, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height());
|
||||
draw_shadow(scrollbar.sa_win, gc_top, gc_bottom, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height(), scrollbar_get_shadow());
|
||||
if (scrollbar_anchor_is_pressed()) {
|
||||
draw_shadow(scrollbar.sa_win, gc_bottom, gc_top, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height(), scrollbar_get_shadow());
|
||||
} else {
|
||||
draw_shadow(scrollbar.sa_win, gc_top, gc_bottom, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height(), scrollbar_get_shadow());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
|
@ -560,7 +562,7 @@ scrollbar_draw_trough(unsigned char image_state, unsigned char force_modes) {
|
|||
}
|
||||
if (!image_mode_is(image_sb, MODE_MASK)) {
|
||||
/* Solid mode. Redraw every time since it's cheap. */
|
||||
if (Options & Opt_scrollbar_floating) {
|
||||
if ((Options & Opt_scrollbar_floating) || (scrollbar.type == SCROLLBAR_XTERM)) {
|
||||
XSetWindowBackground(Xdisplay, scrollbar.win, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, scrollbar.win);
|
||||
} else {
|
||||
|
@ -820,9 +822,9 @@ scrollbar_drawing_init(void) {
|
|||
gcvalue.fill_style = FillOpaqueStippled;
|
||||
gcvalue.foreground = PixColors[fgColor];
|
||||
gcvalue.background = PixColors[bgColor];
|
||||
gc_scrollbar = XCreateGC(Xdisplay, scrollbar.win, GCForeground | GCBackground | GCFillStyle | GCStipple, &gcvalue);
|
||||
gc_stipple = XCreateGC(Xdisplay, scrollbar.win, GCForeground | GCBackground | GCFillStyle | GCStipple, &gcvalue);
|
||||
gcvalue.foreground = PixColors[borderColor];
|
||||
gc_stipple = XCreateGC(Xdisplay, scrollbar.win, GCForeground, &gcvalue);
|
||||
gc_border = XCreateGC(Xdisplay, scrollbar.win, GCForeground, &gcvalue);
|
||||
}
|
||||
#endif /* XTERM_SCROLLBAR */
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#define SCROLLBAR_STATE_MOVING (1UL << 1)
|
||||
#define SCROLLBAR_STATE_UP_CLICKED (1UL << 2)
|
||||
#define SCROLLBAR_STATE_DOWN_CLICKED (1UL << 3)
|
||||
#define SCROLLBAR_STATE_ANCHOR_CLICKED (1UL << 4)
|
||||
#define SCROLLBAR_STATE_MOTION_MASK (SCROLLBAR_STATE_UP_CLICKED | SCROLLBAR_STATE_DOWN_CLICKED | SCROLLBAR_STATE_ANCHOR_CLICKED | SCROLLBAR_STATE_MOVING)
|
||||
|
||||
/* Scrollbar state macros */
|
||||
#define scrollbar_is_visible() (scrollbar.state & SCROLLBAR_STATE_VISIBLE)
|
||||
|
@ -46,11 +48,13 @@
|
|||
#define scrollbar_uparrow_is_pressed() (scrollbar.state & SCROLLBAR_STATE_UP_CLICKED)
|
||||
#define scrollbar_downarrow_is_pressed() (scrollbar.state & SCROLLBAR_STATE_DOWN_CLICKED)
|
||||
#define scrollbar_arrow_is_pressed() (scrollbar.state & (SCROLLBAR_STATE_UP_CLICKED | SCROLLBAR_STATE_DOWN_CLICKED))
|
||||
#define scrollbar_cancel_motion() (scrollbar.state &= ~(SCROLLBAR_STATE_UP_CLICKED | SCROLLBAR_STATE_DOWN_CLICKED | SCROLLBAR_STATE_MOVING))
|
||||
#define scrollbar_anchor_is_pressed() (scrollbar.state & SCROLLBAR_STATE_ANCHOR_CLICKED)
|
||||
#define scrollbar_cancel_motion() (scrollbar.state &= ~(SCROLLBAR_STATE_MOTION_MASK))
|
||||
#define scrollbar_set_visible(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_VISIBLE) : (scrollbar.state &= ~(SCROLLBAR_STATE_VISIBLE)))
|
||||
#define scrollbar_set_motion(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_MOVING) : (scrollbar.state &= ~(SCROLLBAR_STATE_MOVING)))
|
||||
#define scrollbar_set_uparrow_pressed(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_UP_CLICKED) : (scrollbar.state &= ~(SCROLLBAR_STATE_UP_CLICKED)))
|
||||
#define scrollbar_set_downarrow_pressed(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_DOWN_CLICKED) : (scrollbar.state &= ~(SCROLLBAR_STATE_DOWN_CLICKED)))
|
||||
#define scrollbar_set_anchor_pressed(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_ANCHOR_CLICKED) : (scrollbar.state &= ~(SCROLLBAR_STATE_ANCHOR_CLICKED)))
|
||||
|
||||
/* The various scrollbar elements */
|
||||
#define scrollbar_win_is_trough(w) (scrollbar_is_visible() && (w) == scrollbar.win)
|
||||
|
|
|
@ -137,16 +137,16 @@ lookup_key(XEvent * ev)
|
|||
PrivMode((!numlock_state), PrivMode_aplKP);
|
||||
}
|
||||
#ifdef USE_XIM
|
||||
if (Input_Context != NULL) {
|
||||
if (xim_input_context != NULL) {
|
||||
Status status_return;
|
||||
|
||||
kbuf[0] = '\0';
|
||||
len = XmbLookupString(Input_Context, &ev->xkey, (char *) kbuf,
|
||||
len = XmbLookupString(xim_input_context, &ev->xkey, (char *) kbuf,
|
||||
sizeof(short_buf), &keysym, &status_return);
|
||||
if (status_return == XBufferOverflow) {
|
||||
kbuf = (unsigned char *) MALLOC(len + 1);
|
||||
kbuf_alloced = 1;
|
||||
len = XmbLookupString(Input_Context, &ev->xkey, (char *) kbuf, len, &keysym, &status_return);
|
||||
len = XmbLookupString(xim_input_context, &ev->xkey, (char *) kbuf, len, &keysym, &status_return);
|
||||
}
|
||||
valid_keysym = (status_return == XLookupKeySym) || (status_return == XLookupBoth);
|
||||
} else {
|
||||
|
|
|
@ -185,9 +185,6 @@ Create_Windows(int argc, char *argv[])
|
|||
Attributes.backing_store = WhenMapped;
|
||||
Attributes.colormap = cmap;
|
||||
|
||||
TermWin.x = -1;
|
||||
TermWin.y = -1;
|
||||
|
||||
/*
|
||||
* grab colors before netscape does
|
||||
*/
|
||||
|
@ -320,7 +317,7 @@ Create_Windows(int argc, char *argv[])
|
|||
PixColors[unfocusedMenuTopShadowColor] = get_top_shadow_color(PixColors[unfocusedMenuColor], "unfocusedMenuTopShadowColor");
|
||||
}
|
||||
|
||||
szHint.base_width = (2 * TermWin.internalBorder + ((Options & Opt_scrollbar) ? scrollbar_trough_width() : 0));
|
||||
szHint.base_width = (2 * TermWin.internalBorder + ((Options & Opt_scrollbar) ? (scrollbar_get_width() + (2 * scrollbar_get_shadow())) : 0));
|
||||
szHint.base_height = (2 * TermWin.internalBorder);
|
||||
|
||||
flags = (rs_geometry ? XParseGeometry(rs_geometry, &x, &y, &width, &height) : 0);
|
||||
|
@ -414,15 +411,15 @@ Create_Windows(int argc, char *argv[])
|
|||
cursor = XCreateFontCursor(Xdisplay, XC_left_ptr);
|
||||
|
||||
/* the vt window */
|
||||
TermWin.x = (((Options & Opt_scrollbar) && !(Options & Opt_scrollbar_right)) ? (scrollbar_get_width() + (2 * scrollbar_get_shadow())) : 0);
|
||||
TermWin.y = 0;
|
||||
if ((!(Options & Opt_borderless)) && (Options & Opt_backing_store)) {
|
||||
D_X11(("Creating term window with save_under = TRUE\n"));
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, (((Options & Opt_scrollbar) && !(Options & Opt_scrollbar_right)) ? scrollbar_trough_width() : 0), 0,
|
||||
szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, TermWin.x, TermWin.y, szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWBackingStore | CWColormap, &Attributes);
|
||||
} else {
|
||||
D_X11(("Creating term window with no backing store\n"));
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, (((Options & Opt_scrollbar) && !(Options & Opt_scrollbar_right)) ? scrollbar_trough_width() : 0), 0,
|
||||
szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, TermWin.x, TermWin.y, szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWColormap, &Attributes);
|
||||
}
|
||||
if (!(background_is_pixmap()) && !(Options & Opt_borderless)) {
|
||||
|
|
Loading…
Reference in New Issue