which included commits to RCS files with non-trunk default branches.
+2001-01-08 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.40 is released.
+
2000-12-31 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.39 is released.
}
Lisp_Object
-make_general_lisp_hash_table (enum hash_table_test test,
- size_t size,
- double rehash_size,
- double rehash_threshold,
- enum hash_table_weakness weakness)
+make_standard_lisp_hash_table (enum hash_table_test test,
+ size_t size,
+ double rehash_size,
+ double rehash_threshold,
+ enum hash_table_weakness weakness)
{
- Lisp_Object hash_table;
- Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table);
+ hash_table_hash_function_t hash_function = 0;
+ hash_table_test_function_t test_function = 0;
switch (test)
{
case HASH_TABLE_EQ:
- ht->test_function = 0;
- ht->hash_function = 0;
+ test_function = 0;
+ hash_function = 0;
break;
case HASH_TABLE_EQL:
- ht->test_function = lisp_object_eql_equal;
- ht->hash_function = lisp_object_eql_hash;
+ test_function = lisp_object_eql_equal;
+ hash_function = lisp_object_eql_hash;
break;
case HASH_TABLE_EQUAL:
- ht->test_function = lisp_object_equal_equal;
- ht->hash_function = lisp_object_equal_hash;
+ test_function = lisp_object_equal_equal;
+ hash_function = lisp_object_equal_hash;
break;
default:
abort ();
}
+ return make_general_lisp_hash_table (hash_function, test_function,
+ size, rehash_size, rehash_threshold,
+ weakness);
+}
+
+Lisp_Object
+make_general_lisp_hash_table (hash_table_hash_function_t hash_function,
+ hash_table_test_function_t test_function,
+ size_t size,
+ double rehash_size,
+ double rehash_threshold,
+ enum hash_table_weakness weakness)
+{
+ Lisp_Object hash_table;
+ Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table);
+
+ ht->test_function = test_function;
+ ht->hash_function = hash_function;
ht->weakness = weakness;
ht->rehash_size =
enum hash_table_weakness weakness,
enum hash_table_test test)
{
- return make_general_lisp_hash_table (test, size, -1.0, -1.0, weakness);
+ return make_standard_lisp_hash_table (test, size, -1.0, -1.0, weakness);
}
/* Pretty reading of hash tables.
}
/* Create the hash table. */
- hash_table = make_general_lisp_hash_table
+ hash_table = make_standard_lisp_hash_table
(decode_hash_table_test (test),
decode_hash_table_size (size),
decode_hash_table_rehash_size (rehash_size),
VALIDATE_VAR (rehash_threshold);
VALIDATE_VAR (weakness);
- return make_general_lisp_hash_table
+ return make_standard_lisp_hash_table
(decode_hash_table_test (test),
decode_hash_table_size (size),
decode_hash_table_rehash_size (rehash_size),
}
break;
+ /* We seem to be sprouting new weakness types at an alarming
+ rate. At least this is not externally visible - and in
+ fact all of these KEY_CAR_* types are only used by the
+ glyph code. */
+ case HASH_TABLE_KEY_CAR_VALUE_WEAK:
+ for (; e < sentinel; e++)
+ if (!HENTRY_CLEAR_P (e))
+ {
+ if (!CONSP (e->key) || marked_p (XCAR (e->key)))
+ {
+ MARK_OBJ (e->key);
+ MARK_OBJ (e->value);
+ }
+ else if (marked_p (e->value))
+ MARK_OBJ (e->key);
+ }
+ break;
+
case HASH_TABLE_VALUE_CAR_WEAK:
for (; e < sentinel; e++)
if (!HENTRY_CLEAR_P (e))
HASH_TABLE_KEY_VALUE_WEAK,
HASH_TABLE_KEY_CAR_WEAK,
HASH_TABLE_VALUE_CAR_WEAK,
+ HASH_TABLE_KEY_CAR_VALUE_WEAK,
HASH_TABLE_WEAK
};
typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value,
void* extra_arg);
-Lisp_Object make_general_lisp_hash_table (enum hash_table_test test,
+Lisp_Object make_standard_lisp_hash_table (enum hash_table_test test,
+ size_t size,
+ double rehash_size,
+ double rehash_threshold,
+ enum hash_table_weakness weakness);
+
+Lisp_Object make_general_lisp_hash_table (hash_table_hash_function_t hash_function,
+ hash_table_test_function_t test_function,
size_t size,
double rehash_size,
double rehash_threshold,
static int process_events_occurred;
static int tty_events_occurred;
+static Widget widget_with_focus;
/* Mask of bits indicating the descriptors that we wait for input on */
extern SELECT_TYPE input_wait_mask, process_only_mask, tty_only_mask;
handle_focus_event_1 (struct frame *f, int in_p)
{
#if XtSpecificationRelease > 5
- Widget focus_widget = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f));
+ widget_with_focus = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f));
#endif
#ifdef HAVE_XIM
XIM_focus_event (f, in_p);
#endif /* HAVE_XIM */
+
/* On focus change, clear all memory of sticky modifiers
to avoid non-intuitive behavior. */
clear_sticky_modifiers (XDEVICE (FRAME_DEVICE (f)));
click in the frame. Why is this? */
if (in_p
#if XtSpecificationRelease > 5
- && FRAME_X_TEXT_WIDGET (f) != focus_widget
+ && FRAME_X_TEXT_WIDGET (f) != widget_with_focus
#endif
)
{
lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f),
FRAME_X_TEXT_WIDGET (f));
}
+
+ /* We have the focus now. See comment in
+ emacs_Xt_handle_widget_losing_focus (). */
+ if (in_p)
+ widget_with_focus = NULL;
+
/* do the generic event-stream stuff. */
{
Lisp_Object frm;
}
}
+/* The idea here is that when a widget glyph gets unmapped we don't
+ want the focus to stay with it if it has focus - because it may
+ well just get deleted next andthen we have lost the focus until the
+ user does something. So handle_focus_event_1 records the widget
+ with keyboard focus when FocusOut is processed, and then, when a
+ widget gets unmapped, it calls this function to restore focus if
+ appropriate. */
+void emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget);
+void
+emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget)
+{
+ if (losing_widget == widget_with_focus)
+ {
+ handle_focus_event_1 (f, 1);
+ }
+}
+
/* This is called from the external-widget code */
void emacs_Xt_handle_focus_event (XEvent *event);
XFlush (XtDisplay (shell_widget)); /* hey, I'd like to DEBUG this... */
}
-/* Destroy the X window of frame S. */
+/* Destroy the X window of frame F. */
static void
x_delete_frame (struct frame *f)
{
update_tab_widget_face (widget_value* wv,
Lisp_Image_Instance* ii, Lisp_Object domain);
#endif
+void
+emacs_Xt_handle_widget_losing_focus (struct frame* f, Widget losing_widget);
#include "bitmaps.h"
}
else /* must be a widget */
{
+ /* Since we are being unmapped we want the enclosing frame to
+ get focus. The losing with simple scrolling but is the safest
+ thing to do. */
+ emacs_Xt_handle_widget_losing_focus
+ ( XFRAME (IMAGE_INSTANCE_FRAME (p)),
+ IMAGE_INSTANCE_X_WIDGET_ID (p));
XtUnmapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p));
}
}
}
/* Adjust offsets within the frame. */
- if (XFRAME (IMAGE_INSTANCE_FRAME (p))->frame_changed)
+ if (XFRAME (IMAGE_INSTANCE_FRAME (p))->size_changed)
{
Arg al[2];
XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p));
#define IIFORMAT_INHERITS_SHARED_DEVMETHOD(type, from, format, m, fromformat) \
(type##_##format##_image_instantiator_methods->m##_method = from##_##fromformat##_##m)
+#define INSTANTIATOR_TYPE(inst) (XVECTOR_DATA ((inst))[0])
+
struct image_instantiator_methods *
decode_device_ii_format (Lisp_Object device, Lisp_Object format,
Error_behavior errb);
int width, int height, int xoffset, int yoffset,
Lisp_Object domain);
int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w);
+Lisp_Object make_image_instance_cache_hash_table (void);
DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
int given_dest_mask,
Lisp_Object oldval)
{
MARK_MENUBAR_CHANGED;
- /* This is to force subwindow offsets to be recalculated - see
- x_redisplay_widget (). */
- MARK_FRAME_CHANGED (WINDOW_XFRAME (w));
}
static void
p->face_cachels = Dynarr_new (face_cachel);
p->glyph_cachels = Dynarr_new (glyph_cachel);
p->line_start_cache = Dynarr_new (line_start_cache);
- p->subwindow_instance_cache = make_lisp_hash_table (30,
- HASH_TABLE_KEY_VALUE_WEAK,
- HASH_TABLE_EQ);
+ p->subwindow_instance_cache = make_image_instance_cache_hash_table ();
+
p->line_cache_last_updated = Qzero;
INIT_DISP_VARIABLE (last_point_x, 0);
INIT_DISP_VARIABLE (last_point_y, 0);
p->face_cachels = Dynarr_new (face_cachel);
p->glyph_cachels = Dynarr_new (glyph_cachel);
p->subwindow_instance_cache =
- make_lisp_hash_table (30,
- HASH_TABLE_KEY_VALUE_WEAK,
- HASH_TABLE_EQ);
+ make_image_instance_cache_hash_table ();
/* Put new into window structure in place of window */
replace_window (window, new);
set. */
if (NILP (w->subwindow_instance_cache))
w->subwindow_instance_cache =
- make_lisp_hash_table (30,
- HASH_TABLE_KEY_VALUE_WEAK,
- HASH_TABLE_EQ);
+ make_image_instance_cache_hash_table ();
+
SET_LAST_MODIFIED (w, 1);
SET_LAST_FACECHANGE (w);
w->config_mark = 0;
/*
config->frame_width = FRAME_WIDTH (f);
config->frame_height = FRAME_HEIGHT (f); */
- /* When using `push-window-configuration', often the minibuffer ends
+ /* #### When using `push-window-configuration', often the minibuffer ends
up as the selected window because functions run as the result of
user interaction e.g. hyper-apropos. It seems to me the sensible
- thing to do is not record the minibuffer here. */
+ thing to do is not record the minibuffer here.
+
+ #### Unfortunately this is a change to previous behaviour, however logical
+ it may be, so revert for the moment. */
+#if 0
if (FRAME_MINIBUF_ONLY_P (f) || minibuf_level)
config->current_window = FRAME_SELECTED_WINDOW (f);
else
config->current_window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+#endif
+ config->current_window = FRAME_SELECTED_WINDOW (f);
XSETBUFFER (config->current_buffer, current_buffer);
config->minibuffer_scroll_window = Vminibuffer_scroll_window;
config->root_window = FRAME_ROOT_WINDOW (f);
+2001-01-08 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.40 is released.
+
2000-12-31 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.39 is released.