XEmacs 21.2.9
[chise/xemacs-chise.git.1] / src / frame-msw.c
index f7d154a..5a88a67 100644 (file)
@@ -33,8 +33,10 @@ Boston, MA 02111-1307, USA.  */
 #include "lisp.h"
 
 #include "buffer.h"
+#include "elhash.h"
 #include "console-msw.h"
 #include "glyphs-msw.h"
+#include "elhash.h"
 #include "events.h"
 #include "faces.h"
 #include "frame.h"
@@ -126,12 +128,14 @@ mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
   FRAME_MSWINDOWS_DATA(f)->ignore_next_lbutton_up = 0;
   FRAME_MSWINDOWS_DATA(f)->ignore_next_rbutton_up = 0;
   FRAME_MSWINDOWS_DATA(f)->sizing = 0;
-  FRAME_MSWINDOWS_MENU_HASHTABLE(f) = Qnil;
+  FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil;
 #ifdef HAVE_TOOLBARS
-  FRAME_MSWINDOWS_TOOLBAR_HASHTABLE(f) = Fmake_hashtable (make_int (50), 
-                                                         Qequal);
+  FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) = 
+    make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL);
 #endif
-
+  /* hashtable of instantiated glyphs on the frame. */
+  FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f) = 
+    make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQUAL);
   /* Will initialize these in WM_SIZE handler. We cannot do it now,
      because we do not know what is CW_USEDEFAULT height and width */
   FRAME_WIDTH (f) = 0;
@@ -177,7 +181,9 @@ mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
   hwnd = CreateWindowEx (exstyle,
                         XEMACS_CLASS,
                         STRINGP(f->name) ? XSTRING_DATA(f->name) :
-                        (STRINGP(name) ? XSTRING_DATA(name) : XEMACS_CLASS),
+                        (STRINGP(name) ? 
+                         (CONST Extbyte*)XSTRING_DATA(name) : 
+                         (CONST Extbyte*)XEMACS_CLASS),
                         style,
                         rect_default.left, rect_default.top,
                         rect_default.width, rect_default.height,
@@ -234,8 +240,8 @@ mswindows_after_init_frame (struct frame *f, int first_on_device,
      frame is created, it will never be displayed, except for 
      hollow border, unless we start pumping messages. Load progress
      messages show in the bottom of the hollow frame, which is ugly.
-     We redipsplay the initial frame here, so modeline and root window
-     backgorund show.
+     We redisplay the initial frame here, so modeline and root window
+     background show.
   */
   if (first_on_console)
     redisplay ();
@@ -244,10 +250,11 @@ mswindows_after_init_frame (struct frame *f, int first_on_device,
 static void
 mswindows_mark_frame (struct frame *f, void (*markobj) (Lisp_Object))
 {
-  ((markobj) (FRAME_MSWINDOWS_MENU_HASHTABLE (f)));
+  markobj (FRAME_MSWINDOWS_MENU_HASH_TABLE (f));
 #ifdef HAVE_TOOLBARS
-  ((markobj) (FRAME_MSWINDOWS_TOOLBAR_HASHTABLE (f)));
+  markobj (FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f));
 #endif
+  markobj (FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f));
 }
 
 static void
@@ -322,7 +329,7 @@ mswindows_frame_totally_visible_p (struct frame *f)
   RECT rc_me, rc_other, rc_temp;
   HWND hwnd = FRAME_MSWINDOWS_HANDLE(f);
 
-  /* We test against not a whole window rectangle, only agaist its
+  /* We test against not a whole window rectangle, only against its
      client part. So, if non-client are is covered and client area is
      not, we return true. */
   GetClientRect (hwnd, &rc_me);
@@ -393,6 +400,10 @@ mswindows_set_frame_pointer (struct frame *f)
     {
       SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HCURSOR,
                    (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->pointer));
+      /* we only have to do this because GC doesn't cause a mouse
+         event and doesn't give time to event processing even if it
+         did. */
+      SetCursor (XIMAGE_INSTANCE_MSWINDOWS_ICON (f->pointer));
     }
 }