*** empty log message ***
[m17n/m17n-lib.git] / src / m17n-gui.c
index 98247c4..c0bd14a 100644 (file)
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the m17n library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 /***en
@@ -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) ();
@@ -264,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)
@@ -320,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."));
@@ -651,13 +655,12 @@ mframe (MPlist *plist)
       if (! interface->handle)
        {
          if (! (interface->handle = dlopen (interface->library, RTLD_NOW))
-             || ! (interface->init
-                   = (int (*) ()) dlsym (interface->handle, "device_init"))
-             || ! (interface->open
-                   = (int (*) (MFrame *, MPlist *)) dlsym (interface->handle,
-                                                           "device_open"))
-             || ! (interface->fini
-                   = (int (*) ()) dlsym (interface->handle, "device_fini"))
+             || ! (*(void **) (&interface->init)
+                   = dlsym (interface->handle, "device_init"))
+             || ! (*(void **) (&interface->open)
+                   = dlsym (interface->handle, "device_open"))
+             || ! (*(void **) (&interface->fini)
+                   = dlsym (interface->handle, "device_fini"))
              || (*interface->init) () < 0)
            {
              fprintf (stderr, "%s\n", (char *) dlerror ());