X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fglyphs-x.c;h=105bbffc586898e069177f292c54c1d8e23b0a3a;hb=5b3c82206adcee5711107008334ba3ec2837ae2c;hp=5a7101284bc9abab247c5d7c2bf28c7dd1227871;hpb=dbf2768f7b146e97e37a27316f70bb313f1acf15;p=chise%2Fxemacs-chise.git.1 diff --git a/src/glyphs-x.c b/src/glyphs-x.c index 5a71012..105bbff 100644 --- a/src/glyphs-x.c +++ b/src/glyphs-x.c @@ -4,7 +4,7 @@ Copyright (C) 1995 Tinker Systems Copyright (C) 1995, 1996 Ben Wing Copyright (C) 1995 Sun Microsystems - Copyright (C) 1999, 2000 Andy Piper + Copyright (C) 1999, 2000, 2002 Andy Piper This file is part of XEmacs. @@ -158,6 +158,8 @@ update_tab_widget_face (widget_value* wv, #endif void emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget); +void +enqueue_focus_event (Widget wants_it, Lisp_Object frame, int in_p); #include "bitmaps.h" @@ -1148,7 +1150,7 @@ init_image_instance_from_xbm_inline (Lisp_Image_Instance *ii, break; default: - abort (); + ABORT (); } } @@ -1275,7 +1277,7 @@ extract_xpm_color_names (XpmAttributes *xpmattrs, Lisp_Object device, /* Duplicate the pixel value so that we still have a lock on it if the pixel we were passed is later freed. */ if (! XAllocColor (dpy, cmap, &color)) - abort (); /* it must be allocable since we're just duplicating it */ + ABORT (); /* it must be allocable since we're just duplicating it */ symbols [i].name = (char *) XSTRING_DATA (XCAR (cons)); symbols [i].pixel = color.pixel; @@ -1630,7 +1632,7 @@ x_xpm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, break; default: - abort (); + ABORT (); } xpm_free (&xpmattrs); /* after we've read pixels and hotspot */ @@ -2172,6 +2174,14 @@ x_map_subwindow (Lisp_Image_Instance *p, int x, int y, -dga->xoffset, -dga->yoffset); if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p)) XtMapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p)); + /* See comments in glyphs-msw.c about keyboard focus. */ + if (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (p)) { + /* #### FIXME to pop-up the find dialog we map the text-field + seven times! This doesn't show on a fast linux box but does + under X on windows. */ + enqueue_focus_event (IMAGE_INSTANCE_X_WIDGET_ID (p), + IMAGE_INSTANCE_FRAME (p), 1); + } } } @@ -2346,6 +2356,14 @@ x_subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)win; } +/* Account for some of the limitations with widget images. */ +static int +x_widget_border_width (void) +{ + return DEFAULT_WIDGET_BORDER_WIDTH * 2; +} + + #if 0 /* #### Should this function exist? If there's any doubt I'm not implementing it --andyp */ DEFUN ("change-subwindow-property", Fchange_subwindow_property, 3, 3, 0, /* @@ -2508,6 +2526,10 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, free_widget_value_tree (clip_wv); + /* create a sensible name. */ + if (wv->name == 0 || strcmp(wv->name, "") == 0) + wv->name = xstrdup (type); + /* copy any args we were given */ ac = 0; lw_add_value_args_to_args (wv, al, &ac); @@ -2883,6 +2905,7 @@ console_type_create_glyphs_x (void) CONSOLE_HAS_METHOD (x, map_subwindow); CONSOLE_HAS_METHOD (x, redisplay_widget); CONSOLE_HAS_METHOD (x, redisplay_subwindow); + CONSOLE_HAS_METHOD (x, widget_border_width); } void