From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q7RdT-0005Ze-LZ for garchives@archives.gentoo.org; Wed, 06 Apr 2011 12:14:59 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0E48D1C069; Wed, 6 Apr 2011 12:14:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B11871C069 for ; Wed, 6 Apr 2011 12:14:46 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F18B91B4030 for ; Wed, 6 Apr 2011 12:14:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 5B00380065 for ; Wed, 6 Apr 2011 12:14:45 +0000 (UTC) From: "Nirbheek Chauhan" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Nirbheek Chauhan" Message-ID: Subject: [gentoo-commits] proj/gnome:master commit in: gnome-base/libgnomekbd/, gnome-base/libgnomekbd/files/ X-VCS-Repository: proj/gnome X-VCS-Files: gnome-base/libgnomekbd/files/libgnomekbd-3.0.0-gkbdstatus-text-color.patch gnome-base/libgnomekbd/libgnomekbd-3.0.0.1.ebuild gnome-base/libgnomekbd/libgnomekbd-3.0.0.ebuild gnome-base/libgnomekbd/libgnomekbd-9999.ebuild X-VCS-Directories: gnome-base/libgnomekbd/ gnome-base/libgnomekbd/files/ X-VCS-Committer: nirbheek X-VCS-Committer-Name: Nirbheek Chauhan X-VCS-Revision: f3fd8ea494ed329f7f34f90c13c558f3c02d4a81 Date: Wed, 6 Apr 2011 12:14:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: db8a61e4597dd0c844b43e5dae10b145 commit: f3fd8ea494ed329f7f34f90c13c558f3c02d4a81 Author: Nirbheek Chauhan gentoo org> AuthorDate: Wed Apr 6 11:22:56 2011 +0000 Commit: Nirbheek Chauhan gentoo org> CommitDate: Wed Apr 6 11:22:56 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D= commit;h=3Df3fd8ea4 gnome-base/libgnomekbd: 3.0.0 =E2=86=92 3.0.0.1 * Fix use_enable on introspection, reported by SardemFF7 --- .../libgnomekbd-3.0.0-gkbdstatus-text-color.patch | 347 --------------= ------ ...kbd-3.0.0.ebuild =3D> libgnomekbd-3.0.0.1.ebuild} | 7 +- gnome-base/libgnomekbd/libgnomekbd-9999.ebuild | 11 +- 3 files changed, 3 insertions(+), 362 deletions(-) diff --git a/gnome-base/libgnomekbd/files/libgnomekbd-3.0.0-gkbdstatus-te= xt-color.patch b/gnome-base/libgnomekbd/files/libgnomekbd-3.0.0-gkbdstatu= s-text-color.patch deleted file mode 100644 index e2417c3..0000000 --- a/gnome-base/libgnomekbd/files/libgnomekbd-3.0.0-gkbdstatus-text-colo= r.patch +++ /dev/null @@ -1,347 +0,0 @@ -From 0b452d4735c6ef35299e24ffb3faa0cabc5559c3 Mon Sep 17 00:00:00 2001 -From: Vincent Untz -Date: Mon, 4 Apr 2011 19:32:56 +0200 -Subject: [PATCH] Use the right color for text in GkbdStatus - -This is really a big hack: instead of getting the information about how -to draw the font from a GTK+ style, we get it from the GtkStyleContext -from the tray icon widget embedded in the GtkStatusIcon. - -To make this happen, we have to fake the GtkStatusIconPrivate structure, -and we rely on the fact that the tray icon widget is the first element -in this structure. - -https://bugzilla.gnome.org/show_bug.cgi?id=3D642703 ---- - libgnomekbd/gkbd-indicator-config.c | 98 ++++++++++++++++++----------= ------- - libgnomekbd/gkbd-indicator-config.h | 10 ++++ - libgnomekbd/gkbd-status.c | 65 ++++++++++++++--------- - 3 files changed, 100 insertions(+), 73 deletions(-) - -diff --git a/libgnomekbd/gkbd-indicator-config.c b/libgnomekbd/gkbd-indi= cator-config.c -index fdf008b..c678643 100644 ---- a/libgnomekbd/gkbd-indicator-config.c -+++ b/libgnomekbd/gkbd-indicator-config.c -@@ -37,7 +37,6 @@ - /** - * GkbdIndicatorConfig - */ --#define GTK_STYLE_PATH "*PanelWidget*" -=20 - const gchar GKBD_INDICATOR_CONFIG_KEY_SHOW_FLAGS[] =3D "show-flags"; - const gchar GKBD_INDICATOR_CONFIG_KEY_ENABLED_PLUGINS[] =3D -@@ -65,26 +64,8 @@ gkbd_indicator_config_load_font (GkbdIndicatorConfig = * ind_config) - g_settings_get_int (ind_config->settings, - GKBD_INDICATOR_CONFIG_KEY_FONT_SIZE); -=20 -- if (ind_config->font_family =3D=3D NULL || -- ind_config->font_family[0] =3D=3D '\0') { -- PangoFontDescription *fd =3D NULL; -- GtkStyle *style =3D -- gtk_rc_get_style_by_paths (gtk_settings_get_default (), -- GTK_STYLE_PATH, -- GTK_STYLE_PATH, -- GTK_TYPE_LABEL); -- if (style !=3D NULL) -- fd =3D style->font_desc; -- if (fd !=3D NULL) { -- ind_config->font_family =3D -- g_strdup (pango_font_description_get_family -- (fd)); -- ind_config->font_size =3D -- pango_font_description_get_size (fd) / -- PANGO_SCALE; -- } -- } -- xkl_debug (150, "font: [%s], size %d\n", ind_config->font_family, -+ xkl_debug (150, "font: [%s], size %d\n", -+ ind_config->font_family ? ind_config->font_family : "(null)", - ind_config->font_size); -=20 - } -@@ -96,38 +77,61 @@ gkbd_indicator_config_load_colors (GkbdIndicatorConf= ig * ind_config) - g_settings_get_string (ind_config->settings, - GKBD_INDICATOR_CONFIG_KEY_FOREGROUND_COLOR); -=20 -- if (ind_config->foreground_color =3D=3D NULL || -- ind_config->foreground_color[0] =3D=3D '\0') { -- GtkStyle *style =3D -- gtk_rc_get_style_by_paths (gtk_settings_get_default (), -- GTK_STYLE_PATH, -- GTK_STYLE_PATH, -- GTK_TYPE_LABEL); -- if (style !=3D NULL) { -- ind_config->foreground_color =3D -- g_strdup_printf ("%g %g %g", ((double) -- style->fg -- [GTK_STATE_NORMAL]. -- red) -- / 0x10000, ((double) -- style->fg -- [GTK_STATE_NORMAL]. -- green) -- / 0x10000, ((double) -- style->fg -- [GTK_STATE_NORMAL]. -- blue) -- / 0x10000); -- } -- -- } -- - ind_config->background_color =3D - g_settings_get_string (ind_config->settings, - GKBD_INDICATOR_CONFIG_KEY_BACKGROUND_COLOR); - } -=20 - void -+gkbd_indicator_config_get_font_for_widget (GkbdIndicatorConfig * ind_co= nfig, -+ GtkWidget * widget, -+ gchar ** font_family, -+ int * font_size) -+{ -+ GtkStyleContext *context; -+ const PangoFontDescription *fd =3D NULL; -+ -+ g_return_if_fail (GTK_IS_WIDGET (widget)); -+ -+ if (ind_config->font_family !=3D NULL && -+ ind_config->font_family[0] !=3D '\0') { -+ if (font_family) -+ *font_family =3D g_strdup (ind_config->font_family); -+ if (font_size) -+ *font_size =3D ind_config->font_size; -+ -+ return; -+ } -+ -+ context =3D gtk_widget_get_style_context (widget); -+ fd =3D gtk_style_context_get_font (context, GTK_STATE_FLAG_NORMAL); -+ -+ if (font_family) -+ *font_family =3D g_strdup (pango_font_description_get_family (fd)); -+ if (font_size) -+ *font_size =3D pango_font_description_get_size (fd) / PANGO_SCALE; -+} -+ -+gchar * -+gkbd_indicator_config_get_fg_color_for_widget (GkbdIndicatorConfig * in= d_config, -+ GtkWidget * widget) -+{ -+ GtkStyleContext *context; -+ GdkRGBA rgba; -+ -+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); -+ -+ if (ind_config->foreground_color !=3D NULL && -+ ind_config->foreground_color[0] !=3D '\0') -+ return g_strdup (ind_config->foreground_color); -+ -+ context =3D gtk_widget_get_style_context (widget); -+ gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &rgba); -+ -+ return g_strdup_printf ("%g %g %g", rgba.red, rgba.green, rgba.blue); -+} -+ -+void - gkbd_indicator_config_refresh_style (GkbdIndicatorConfig * ind_config) - { - g_free (ind_config->font_family); -diff --git a/libgnomekbd/gkbd-indicator-config.h b/libgnomekbd/gkbd-indi= cator-config.h -index 2638895..9b9d935 100644 ---- a/libgnomekbd/gkbd-indicator-config.h -+++ b/libgnomekbd/gkbd-indicator-config.h -@@ -62,6 +62,16 @@ extern void gkbd_indicator_config_load (GkbdIndicator= Config - extern void gkbd_indicator_config_save (GkbdIndicatorConfig * - applet_config); -=20 -+extern void -+gkbd_indicator_config_get_font_for_widget (GkbdIndicatorConfig * ind_co= nfig, -+ GtkWidget * widget, -+ gchar ** font_family, -+ int * font_size); -+ -+extern gchar * -+gkbd_indicator_config_get_fg_color_for_widget (GkbdIndicatorConfig * in= d_config, -+ GtkWidget * widget); -+ - extern void gkbd_indicator_config_refresh_style (GkbdIndicatorConfig * - applet_config); -=20 -diff --git a/libgnomekbd/gkbd-status.c b/libgnomekbd/gkbd-status.c -index 5785e4c..276fe54 100644 ---- a/libgnomekbd/gkbd-status.c -+++ b/libgnomekbd/gkbd-status.c -@@ -59,22 +59,26 @@ static gki_globals globals; -=20 - G_DEFINE_TYPE (GkbdStatus, gkbd_status, GTK_TYPE_STATUS_ICON) -=20 -+typedef struct { -+ GtkWidget *tray_icon; -+} GkbdStatusPrivHack; -+ - static void - gkbd_status_global_init (void); - static void - gkbd_status_global_term (void); - static GdkPixbuf * --gkbd_status_prepare_drawing (int group); -+gkbd_status_prepare_drawing (GkbdStatus * gki, int group); - static void - gkbd_status_set_current_page_for_group (GkbdStatus * gki, int group); - static void - gkbd_status_set_current_page (GkbdStatus * gki); - static void --gkbd_status_reinit_globals (void); -+gkbd_status_reinit_globals (GkbdStatus * gki); - static void - gkbd_status_cleanup_icons (void); - static void --gkbd_status_fill_icons (void); -+gkbd_status_fill_icons (GkbdStatus * gki); - static void - gkbd_status_set_tooltips (GkbdStatus * gki, const char *str); -=20 -@@ -97,8 +101,8 @@ gkbd_status_cleanup_icons () - } - } -=20 --void --gkbd_status_fill_icons () -+static void -+gkbd_status_fill_icons (GkbdStatus * gki) - { - int grp; - int total_groups =3D -@@ -106,7 +110,7 @@ gkbd_status_fill_icons () - (globals.config)); -=20 - for (grp =3D 0; grp < total_groups; grp++) { -- GdkPixbuf *page =3D gkbd_status_prepare_drawing (grp); -+ GdkPixbuf *page =3D gkbd_status_prepare_drawing (gki, grp); - globals.icons =3D g_slist_append (globals.icons, page); - } - } -@@ -119,9 +123,12 @@ gkbd_status_activate (GkbdStatus * gki) - } -=20 - static void --gkbd_status_render_cairo (cairo_t * cr, int group) -+gkbd_status_render_cairo (GkbdStatusPrivHack * gkh, cairo_t * cr, int g= roup) - { - double r, g, b; -+ GdkColor *fg_color; -+ gchar *font_family; -+ int font_size; - PangoFontDescription *pfd; - PangoContext *pcc; - PangoLayout *pl; -@@ -146,28 +153,30 @@ gkbd_status_render_cairo (cairo_t * cr, int group) - } - } -=20 -- if (ind_cfg->foreground_color !=3D NULL && -- ind_cfg->foreground_color[0] !=3D 0) { -- if (sscanf -- (ind_cfg->foreground_color, "%lg %lg %lg", &r, -- &g, &b) =3D=3D 3) { -- cairo_set_source_rgb (cr, r, g, b); -- } -- } -+ g_object_get (gkh->tray_icon, "fg-color", &fg_color, NULL); -+ cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->bl= ue); -+ gdk_color_free (fg_color); -+ -+ gkbd_indicator_config_get_font_for_widget (ind_cfg, -+ gkh->tray_icon, -+ &font_family, -+ &font_size); -=20 -- if (ind_cfg->font_family !=3D NULL && ind_cfg->font_family[0] !=3D 0) = { -- cairo_select_font_face (cr, ind_cfg->font_family, -+ if (font_family !=3D NULL && font_family[0] !=3D 0) { -+ cairo_select_font_face (cr, font_family, - CAIRO_FONT_SLANT_NORMAL, - CAIRO_FONT_WEIGHT_NORMAL); - } -=20 - pfd =3D pango_font_description_new (); -- pango_font_description_set_family (pfd, ind_cfg->font_family); -+ pango_font_description_set_family (pfd, font_family); - pango_font_description_set_style (pfd, PANGO_STYLE_NORMAL); - pango_font_description_set_weight (pfd, PANGO_WEIGHT_NORMAL); - pango_font_description_set_size (pfd, - ind_cfg->font_size * PANGO_SCALE); -=20 -+ g_free (font_family); -+ - pcc =3D pango_cairo_create_context (cr); -=20 - fo =3D cairo_font_options_copy (gdk_screen_get_font_options -@@ -261,7 +270,7 @@ convert_bgra_to_rgba (guint8 const *src, guint8 * ds= t, int width, - } -=20 - static GdkPixbuf * --gkbd_status_prepare_drawing (int group) -+gkbd_status_prepare_drawing (GkbdStatus * gki, int group) - { - GError *gerror =3D NULL; - char *image_filename; -@@ -321,7 +330,8 @@ gkbd_status_prepare_drawing (int group) - globals.current_height); - unsigned char *cairo_data; - guchar *pixbuf_data; -- gkbd_status_render_cairo (cairo_create (cs), group); -+ gkbd_status_render_cairo ((GkbdStatusPrivHack *) GTK_STATUS_ICON (gki= )->priv, -+ cairo_create (cs), group); - cairo_data =3D cairo_image_surface_get_data (cs); - #if 0 - char pngfilename[20]; -@@ -372,11 +382,11 @@ gkbd_status_update_tooltips (GkbdStatus * gki) - } - } -=20 --void --gkbd_status_reinit_globals () -+static void -+gkbd_status_reinit_globals (GkbdStatus * gki) - { - gkbd_status_cleanup_icons (); -- gkbd_status_fill_icons (); -+ gkbd_status_fill_icons (gki); - } -=20 - void -@@ -389,8 +399,11 @@ gkbd_status_reinit_ui (GkbdStatus * gki) - static void - gkbd_status_cfg_callback (GkbdConfiguration * configuration) - { -+ GSList *objects; - xkl_debug (150, "Config changed: reinit ui\n"); -- gkbd_status_reinit_globals (); -+ objects =3D gkbd_configuration_get_all_objects (configuration); -+ if (objects) -+ gkbd_status_reinit_globals (objects->data); - ForAllObjects (configuration) { - gkbd_status_reinit_ui (GKBD_STATUS (gki)); - } NextObject () -@@ -499,7 +512,7 @@ gkbd_status_size_changed (GkbdStatus * gki, gint siz= e) - if (globals.current_height !=3D size) { - globals.current_height =3D size; - globals.current_width =3D size * 3 / 2; -- gkbd_status_reinit_globals (); -+ gkbd_status_reinit_globals (gki); - gkbd_status_reinit_ui (gki); - } - } -@@ -511,7 +524,7 @@ gkbd_status_theme_changed (GtkSettings * settings, G= ParamSpec * pspec, - xkl_debug (150, "Theme changed\n"); - gkbd_indicator_config_refresh_style - (gkbd_configuration_get_indicator_config (globals.config)); -- gkbd_status_reinit_globals (); -+ gkbd_status_reinit_globals (gki); - gkbd_status_reinit_ui (gki); - } -=20 ---=20 -1.7.4.1 \ No newline at end of file diff --git a/gnome-base/libgnomekbd/libgnomekbd-3.0.0.ebuild b/gnome-base= /libgnomekbd/libgnomekbd-3.0.0.1.ebuild similarity index 85% rename from gnome-base/libgnomekbd/libgnomekbd-3.0.0.ebuild rename to gnome-base/libgnomekbd/libgnomekbd-3.0.0.1.ebuild index 98e7ffb..ab94e32 100644 --- a/gnome-base/libgnomekbd/libgnomekbd-3.0.0.ebuild +++ b/gnome-base/libgnomekbd/libgnomekbd-3.0.0.1.ebuild @@ -34,12 +34,7 @@ pkg_setup() { G2CONF=3D"${G2CONF} --disable-static --disable-schemas-compile + $(use_enable introspection) $(use_enable test tests)" DOCS=3D"AUTHORS ChangeLog NEWS README" } - -src_prepare() { - # https://bugzilla.gnome.org/show_bug.cgi?id=3D642703, not needed for n= ext release - epatch "${FILESDIR}/${P}-gkbdstatus-text-color.patch" - gnome2_src_prepare -} diff --git a/gnome-base/libgnomekbd/libgnomekbd-9999.ebuild b/gnome-base/= libgnomekbd/libgnomekbd-9999.ebuild index 955ec51..ab94e32 100644 --- a/gnome-base/libgnomekbd/libgnomekbd-9999.ebuild +++ b/gnome-base/libgnomekbd/libgnomekbd-9999.ebuild @@ -6,7 +6,7 @@ EAPI=3D"3" GCONF_DEBUG=3D"no" GNOME2_LA_PUNT=3D"yes" =20 -inherit gnome2 +inherit eutils gnome2 =20 DESCRIPTION=3D"Gnome keyboard configuration library" HOMEPAGE=3D"http://www.gnome.org" @@ -34,14 +34,7 @@ pkg_setup() { G2CONF=3D"${G2CONF} --disable-static --disable-schemas-compile + $(use_enable introspection) $(use_enable test tests)" DOCS=3D"AUTHORS ChangeLog NEWS README" } - -#src_compile() { - # FreeBSD doesn't like -j, upstream? bug #176517 - # FIXME: Please re-test and notify us if still valid, - # disabling for now - # use x86-fbsd && MAKEOPTS=3D"${MAKEOPTS} -j1" -# gnome2_src_compile -#}