*** empty log message ***
[m17n/m17n-lib.git] / src / m17n-gui.c
index 6e58efe..44c204c 100644 (file)
@@ -88,7 +88,7 @@ typedef struct
 {
   /** Name of the dynamic library (e.g. "libm17n-X.so").  */
   char *library;
-  /** Handle fo the dynamic library.  */
+  /** Handle of the dynamic library.  */
   void *handle;
   /** Function to call just after loading the library.  */
   int (*init) ();
@@ -209,6 +209,9 @@ null_device_open (MFrame *frame, MPlist *param)
 
   frame->device = NULL;
   frame->device_type = 0;
+  frame->dpi = (int) mplist_get (param, Mresolution);
+  if (frame->dpi == 0)
+    frame->dpi = 100;
   frame->driver = &null_driver;
   frame->font_driver_list = mplist ();
   mplist_add (frame->font_driver_list, Mfreetype, &mfont__ft_driver);
@@ -261,6 +264,7 @@ m17n_init_win (void)
   Mdrawable = msymbol ("drawable");
   Mdepth = msymbol ("depth");
   Mwidget = msymbol ("widget");
+  Mcolormap = msymbol ("colormap");
 
   MDEBUG_PUSH_TIME ();
   if (mfont__init () < 0)
@@ -317,19 +321,22 @@ m17n_fini_win (void)
     }
 #ifdef HAVE_FREETYPE
   if (null_interface.handle)
-    (*null_interface.fini) ();
+    {
+      (*null_interface.fini) ();
+      null_interface.handle = NULL;
+    }
 #endif /* not HAVE_FREETYPE */
   M17N_OBJECT_UNREF (device_library_list);
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input-gui module."));
   minput__win_fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize draw module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize input-gui module."));
   mdraw__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize face module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize draw module."));
   mface__fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize fontset module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize face module."));
   mfont__fontset_fini ();
-  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize font module."));
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize fontset module."));
   mfont__fini ();
+  MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize font module."));
   mframe_default = NULL;
   MDEBUG_POP_TIME ();
   MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the gui modules."));
@@ -680,8 +687,8 @@ mframe (MPlist *plist)
     if (MPLIST_KEY (pl) == Mface)
       mface_merge (frame->face, (MFace *) MPLIST_VAL (pl));
   mface__update_frame_face (frame);
-  frame->font = frame->rface->rfont ? frame->rface->rfont->font : NULL;
-
+  frame->font
+    = frame->rface->rfont ? (MFont *) frame->rface->rfont : NULL;
   if (plist_created)
     M17N_OBJECT_UNREF (plist);
   return frame;
@@ -775,9 +782,9 @@ mframe_get_prop (MFrame *frame, MSymbol key)
   if (key == Mface)
     return frame->face;
   if (key == Mfont)
-    return (frame->rface->rfont ? frame->rface->rfont->font : NULL);
+    return frame->font;
   if (key == Mfont_width)
-    return (void *) (frame->space_width);
+    return (void *) (frame->average_width);
   if (key == Mfont_ascent)
     return (void *) (frame->ascent);
   if (key == Mfont_descent)