X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fm17n-gui.c;h=c0bd14a51ce4478618d127b32ff759b51c47ec43;hb=0793e3bffb93b37b42eab1223c19ffc70c4ba1ae;hp=6e58efed1326a53ab8e9a899e68e9a023fff18a9;hpb=68568403ee1d614815a23a722d520812b6f98bfd;p=m17n%2Fm17n-lib.git diff --git a/src/m17n-gui.c b/src/m17n-gui.c index 6e58efe..c0bd14a 100644 --- a/src/m17n-gui.c +++ b/src/m17n-gui.c @@ -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) (); @@ -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.")); @@ -648,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 ()); @@ -680,8 +686,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 +781,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)