[maemo-commits] [maemo-commits] r12932 - in projects/haf/trunk/maemo-launcher: . debian launcher
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Jul 30 20:58:55 EEST 2007
- Previous message: [maemo-commits] r12931 - in projects/haf/trunk/hildon-fm: . debian
- Next message: [maemo-commits] r12933 - in projects/haf/trunk/matchbox-window-manager: debian snapshot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: guillem Date: 2007-07-30 20:58:50 +0300 (Mon, 30 Jul 2007) New Revision: 12932 Modified: projects/haf/trunk/maemo-launcher/ChangeLog projects/haf/trunk/maemo-launcher/README projects/haf/trunk/maemo-launcher/debian/changelog projects/haf/trunk/maemo-launcher/debian/control projects/haf/trunk/maemo-launcher/launcher/booster_gtk.c projects/haf/trunk/maemo-launcher/launcher/booster_gtk.h Log: Update gtk booster module to support gtk+ 2.10. Thanks to Johannes Schmid <johannes.schmid at openismus.com> for the initial patch. (Fixes: NM#952) Modified: projects/haf/trunk/maemo-launcher/ChangeLog =================================================================== --- projects/haf/trunk/maemo-launcher/ChangeLog 2007-07-30 17:10:23 UTC (rev 12931) +++ projects/haf/trunk/maemo-launcher/ChangeLog 2007-07-30 17:58:50 UTC (rev 12932) @@ -1,3 +1,18 @@ +2007-07-27 Johannes Schmid <johannes.schmid at openismus.com> + Guillem Jover <guillem.jover at nokia.com> + + * launcher/booster_gtk.c: Stop including <pango/pangoxft.h> and + <X11/Xft/Xft.h>. Include <pango/pangocairo.h>. + (init_cairo): New function. + (booster_gtk_preinit): Stop initializing Xft, and storing the + GtkSettings. Call init_cairo. + (pango_default_substitute): Remove function. Remove all callers. + (booster_gtk_init): Do not restore the GtkSettings from state. + (booster_gtk_reload): Empty function. + * launcher/booster_gtk.h (gquark_name_list): Remove Xft related + strings. + * README: Update. + 2007-07-26 Guillem Jover <guillem.jover at nokia.com> * launcher/Makefile.am (dist_pkgconfig_DATA): Add Modified: projects/haf/trunk/maemo-launcher/README =================================================================== --- projects/haf/trunk/maemo-launcher/README 2007-07-30 17:10:23 UTC (rev 12931) +++ projects/haf/trunk/maemo-launcher/README 2007-07-30 17:58:50 UTC (rev 12932) @@ -11,21 +11,13 @@ The only current useful booster module is for gtk, with an option to link against the hildon library to speedup symbol resolving. This module -opens a new GdkDisplay, makes it the default and forces all gtkrc files -to be parsed and initializes some other components like pango, stores the -GtkSettings object that was associated with the display's default screen -(this is a hack, the settings and all cached gtkrc stuff should be deleted -if display/screen closing was implemented correctly, but they aren't because -display/screen closing is not supported at the moment), then it closes the -GdkDisplay. +preinitializes components like pango and cairo. -When an application is invoked it forks, tries to restore the environment as -if it had been started directy, dynamically opens the application, opens a -new display and associates its screen with the stored state (the GtkSettings; -this is the second hack which only works because we *know* the new display's -properties are identical to the old display's ones). And afterwards launches -the application by calling the "main" function. The maemo-invoker will proxy -the application exit status back by default. +When an application is invoked, it forks, tries to restore the state it +might have saved during the preinitialization step and the environment as +if it had been started directy, dynamically opens the application, and +afterwards launches the application by calling the "main" function. The +maemo-invoker will proxy the application exit status back by default. The launcher is listening to a unix socket for notifications of new applications to be launched. The maemo-invoker is the program in charge to @@ -48,10 +40,6 @@ executables and dlopen()-able objects. If running them as executable is not a requirement, "-rdynamic" or "-shared" is good enough. -Transferring the GtkSettings to the child's screen is a hack, therefore it -will only work if we open the "same" display again (the same display on the -same server with the same visuals and colormaps). - gnome_vfs_init() cannot be called by the daemon because it opens a pipe to the vfs daemon. @@ -62,9 +50,6 @@ to be safe against possible future changes in maemo-launcher. -Until display/screen closing is fully supported, we should not do anything -with the original display, esp. not opening windows on it. - The children are dlopen()ed using RTLD_LAZY, so symbol relocation errors are not caught at the time we call dlopen(). Instead, the child will crash randomly at any later point if the libraries it depends on are somehow messed. @@ -171,11 +156,7 @@ Install the package, and start the application from the Task Navigator. Check as much as possible for extraneous behaviour. -WARNING: The launcher requires a modified libgdk, if it's not present -the launcher itself will segfault. That version is present on w2005-24 -release. - Enabling the launcher after checking that it works -------------------------------------------------- Modified: projects/haf/trunk/maemo-launcher/debian/changelog =================================================================== --- projects/haf/trunk/maemo-launcher/debian/changelog 2007-07-30 17:10:23 UTC (rev 12931) +++ projects/haf/trunk/maemo-launcher/debian/changelog 2007-07-30 17:58:50 UTC (rev 12932) @@ -1,6 +1,10 @@ maemo-launcher (0.22~-1) UNRELEASED; urgency=low * New Upstream Release. + - Update gtk booster module to support gtk+ 2.10. (Fixes: NM#952) + Thanks to Johannes Schmid <johannes.schmid at openismus.com> for the + initial patch. + * Remove Build-Depends on libxft-dev. * Add new package maemo-launcher-dev and include the header file for the boosters and the pkgconfig file. (Fixes: NM#1027) * Load the program binary after having adjusted the process priority and Modified: projects/haf/trunk/maemo-launcher/debian/control =================================================================== --- projects/haf/trunk/maemo-launcher/debian/control 2007-07-30 17:10:23 UTC (rev 12931) +++ projects/haf/trunk/maemo-launcher/debian/control 2007-07-30 17:58:50 UTC (rev 12932) @@ -2,7 +2,7 @@ Section: embedded Priority: optional Maintainer: Guillem Jover <guillem.jover at nokia.com> -Build-Depends: debhelper (>= 4.0.0), libgtk2.0-dev (>= 2.6.4-1), libxft-dev, +Build-Depends: debhelper (>= 4.0.0), libgtk2.0-dev (>= 2.6.4-1), libfontconfig1-dev, libpango1.0-dev, libdbus-1-dev (>= 0.60-1), gtkhtml-dev, clinkc-dev, libosso-dev, libosso-help-dev, libosso-gnomevfs2-dev (>= 2.8.0-1), libhildonmime-dev, libhildonfm2-dev, Modified: projects/haf/trunk/maemo-launcher/launcher/booster_gtk.c =================================================================== --- projects/haf/trunk/maemo-launcher/launcher/booster_gtk.c 2007-07-30 17:10:23 UTC (rev 12931) +++ projects/haf/trunk/maemo-launcher/launcher/booster_gtk.c 2007-07-30 17:58:50 UTC (rev 12932) @@ -30,8 +30,7 @@ #include <gdk/gdkx.h> #include <gtk/gtk.h> #include <fontconfig/fontconfig.h> -#include <pango/pangoxft.h> -#include <X11/Xft/Xft.h> +#include <pango/pangocairo.h> #include "booster.h" #include "booster_gtk.h" @@ -130,11 +129,26 @@ return 0; } +static void +init_cairo(void) +{ + cairo_surface_t *surface; + cairo_t *cairo; + PangoContext *context; + PangoLayout *layout; + PangoFontMap *font_map; + + surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, 1, 1); + cairo = cairo_create(surface); + font_map = pango_cairo_font_map_get_default(); + context = pango_cairo_font_map_create_context(font_map); + layout = pango_layout_new(context); + pango_cairo_show_layout(cairo, layout); +} + static booster_state_t booster_gtk_preinit(int *argc, char ***argv) { - GdkDisplay *display; - GtkSettings *settings; GtkStyle *style; #ifdef DEBUG GTimer *timer; @@ -142,23 +156,11 @@ timer = g_timer_new(); #endif - /* This one is actually called from XftInit, but we should not assume - indirect dependencies. */ if (!FcInit()) error("FcInit() failed"); debug("FcInit() took %f seconds\n", g_timer_elapsed(timer, NULL)); - if (!XftInit(0)) - error("XftInit() failed"); - - debug("XftInit() took %f seconds\n", g_timer_elapsed(timer, NULL)); - - if (!XftInitFtLibrary()) - error("XftInitFtLibrary() failed"); - - debug("XftInitFtLibrary() took %f seconds\n", g_timer_elapsed(timer, NULL)); - if (!gtk_parse_args(argc, argv)) error("gtk_parse_args() failed"); @@ -173,107 +175,18 @@ debug("init_gquarks() took %f seconds\n", g_timer_elapsed(timer, NULL)); - display = gdk_display_open(gdk_get_display_arg_name()); - gdk_display_manager_set_default_display(gdk_display_manager_get(), display); + init_cairo(); + + debug("init_cairo() took %f seconds\n", g_timer_elapsed(timer, NULL)); + style = gtk_style_new(); g_object_unref(style); debug("gtk_style_new() took %f seconds\n", g_timer_elapsed(timer, NULL)); - settings = gtk_settings_get_default(); - - debug("gtk_settings_get_default() took %f seconds\n", - g_timer_elapsed(timer, NULL)); - - gdk_display_close(display); - - debug("gdk_display_close() took %f seconds\n", g_timer_elapsed(timer, NULL)); - - return settings; + return NULL; } -/* - * Keep in sync with gtk/gtksetting.c (gtk_default_substitute). - */ -static void -pango_default_substitute(FcPattern *pattern, gpointer data) -{ - GtkSettings *settings = data; - gint antialias; - gint hinting; - char *rgba; - char *hintstyle; - gint dpi; - FcValue v; - - g_object_get(settings, - "gtk-xft-antialias", &antialias, - "gtk-xft-hinting", &hinting, - "gtk-xft-hintstyle", &hintstyle, - "gtk-xft-rgba", &rgba, - "gtk-xft-dpi", &dpi, - NULL); - - if (antialias >= 0 && - FcPatternGet(pattern, FC_ANTIALIAS, 0, &v) == FcResultNoMatch) - FcPatternAddBool(pattern, FC_ANTIALIAS, antialias != 0); - - if (hinting >= 0 && - FcPatternGet(pattern, FC_HINTING, 0, &v) == FcResultNoMatch) - FcPatternAddBool(pattern, FC_HINTING, hinting != 0); - -#ifdef FC_HINT_STYLE - if (hintstyle && - FcPatternGet(pattern, FC_HINT_STYLE, 0, &v) == FcResultNoMatch) - { - int val = FC_HINT_FULL; /* Quiet GCC. */ - gboolean found = TRUE; - - if (strcmp(hintstyle, "hintnone") == 0) - val = FC_HINT_NONE; - else if (strcmp(hintstyle, "hintslight") == 0) - val = FC_HINT_SLIGHT; - else if (strcmp(hintstyle, "hintmedium") == 0) - val = FC_HINT_MEDIUM; - else if (strcmp(hintstyle, "hintfull") == 0) - val = FC_HINT_FULL; - else - found = FALSE; - - if (found) - FcPatternAddInteger(pattern, FC_HINT_STYLE, val); - } -#endif /* FC_HINT_STYLE */ - - if (rgba && FcPatternGet(pattern, FC_RGBA, 0, &v) == FcResultNoMatch) - { - int val = FC_RGBA_NONE; /* Quiet GCC. */ - gboolean found = TRUE; - - if (strcmp(rgba, "none") == 0) - val = FC_RGBA_NONE; - else if (strcmp(rgba, "rgb") == 0) - val = FC_RGBA_RGB; - else if (strcmp(rgba, "bgr") == 0) - val = FC_RGBA_BGR; - else if (strcmp(rgba, "vrgb") == 0) - val = FC_RGBA_VRGB; - else if (strcmp(rgba, "vbgr") == 0) - val = FC_RGBA_VBGR; - else - found = FALSE; - - if (found) - FcPatternAddInteger(pattern, FC_RGBA, val); - } - - if (dpi >= 0 && FcPatternGet(pattern, FC_DPI, 0, &v) == FcResultNoMatch) - FcPatternAddDouble(pattern, FC_DPI, dpi/1024.); - - g_free(hintstyle); - g_free(rgba); -} - #ifdef DEBUG static gboolean timestamp_func(gpointer data) @@ -291,9 +204,6 @@ booster_gtk_init(const char *progfilename, const booster_state_t state) { char *progname; - GtkSettings *settings = state; - GdkDisplay *display; - GdkScreen *screen; #ifdef DEBUG GTimer *ltimer; @@ -310,43 +220,11 @@ gdk_set_program_class(progname); free(progname); - - /* Open a new display, i.e. a new X connection and make it the default. */ - display = gdk_display_open(gdk_get_display_arg_name()); - gdk_display_manager_set_default_display(gdk_display_manager_get(), - display); - - screen = gdk_screen_get_default(); - - /* Associate the old settings with the new display's default screen. */ - settings->screen = screen; - g_object_set_data(G_OBJECT(screen), "gtk-settings", settings); - - pango_xft_set_default_substitute(GDK_DISPLAY_XDISPLAY(display), - GDK_SCREEN_XNUMBER(screen), - pango_default_substitute, - settings, NULL); } static void booster_gtk_reload(booster_state_t state) { - GtkSettings *settings = state; - GdkDisplay *display; - GdkScreen *screen; - - display = gdk_display_open(gdk_get_display_arg_name()); - gdk_display_manager_set_default_display(gdk_display_manager_get(), display); - - screen = gdk_screen_get_default(); - - /* Associate the old settings with the new display's default screen. */ - settings->screen = screen; - g_object_set_data(G_OBJECT(screen), "gtk-settings", settings); - - gtk_rc_reparse_all_for_settings(settings, FALSE); - - gdk_display_close(display); } booster_api_t booster_gtk_api = { Modified: projects/haf/trunk/maemo-launcher/launcher/booster_gtk.h =================================================================== --- projects/haf/trunk/maemo-launcher/launcher/booster_gtk.h 2007-07-30 17:10:23 UTC (rev 12931) +++ projects/haf/trunk/maemo-launcher/launcher/booster_gtk.h 2007-07-30 17:58:50 UTC (rev 12932) @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) 2005, 2006 Nokia Corporation + * Copyright (C) 2005, 2006, 2007 Nokia Corporation * * Autogenerated file * @@ -597,11 +597,6 @@ "gtk-window-key-hash", "GtkWindowPosition", "GtkWindowType", - "gtk-xft-antialias", - "gtk-xft-dpi", - "gtk-xft-hinting", - "gtk-xft-hintstyle", - "gtk-xft-rgba", "GTypeModule", "GTypePlugin", "-g-type-private--dependants-array", @@ -912,8 +907,6 @@ "PangoStyle", "PangoUnderline", "PangoVariant", - "PangoXftFont", - "PangoXftFontMap", "parent", "parent_set", "parent-set",
- Previous message: [maemo-commits] r12931 - in projects/haf/trunk/hildon-fm: . debian
- Next message: [maemo-commits] r12933 - in projects/haf/trunk/matchbox-window-manager: debian snapshot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]