[libchamplain] Use clutter-gtk 1.0
- From: Jiřà Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Use clutter-gtk 1.0
- Date: Sat, 1 Jan 2011 15:16:54 +0000 (UTC)
commit e39dbbdba9fc632fbacdda2bd060f5ccaf7d2bbe
Author: JiÅ?Ã Techet <techet gmail com>
Date: Thu Dec 30 20:22:35 2010 +0100
Use clutter-gtk 1.0
Implement the missing functions from clutter-gtk 1.0 manually
champlain-gtk-uninstalled.pc.in | 2 +-
champlain-gtk.pc.in | 2 +-
champlain-gtk/gtk-champlain-embed.c | 20 +++++++++++++++++---
3 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/champlain-gtk-uninstalled.pc.in b/champlain-gtk-uninstalled.pc.in
index dea3cc5..23e5011 100644
--- a/champlain-gtk-uninstalled.pc.in
+++ b/champlain-gtk-uninstalled.pc.in
@@ -8,4 +8,4 @@ Description: Gtk+ Widget wrapper for libchamplain
Version: @VERSION@
Libs: ${abs_top_builddir}/champlain-gtk/libchamplain-gtk- CHAMPLAIN_API_VERSION@.la
Cflags: -I${abs_top_srcdir} -I${abs_top_builddir}
-Requires: champlain- CHAMPLAIN_API_VERSION@-uninstalled clutter-gtk-0.10 gtk+-3.0
+Requires: champlain- CHAMPLAIN_API_VERSION@-uninstalled clutter-gtk-1.0 gtk+-3.0
diff --git a/champlain-gtk.pc.in b/champlain-gtk.pc.in
index 2c461b6..c933537 100644
--- a/champlain-gtk.pc.in
+++ b/champlain-gtk.pc.in
@@ -8,4 +8,4 @@ Description: Gtk+ Widget wrapper for libchamplain
Version: @VERSION@
Libs: -L${libdir} -lchamplain-gtk- CHAMPLAIN_API_VERSION@
Cflags: -I${includedir}/libchamplain-gtk- CHAMPLAIN_API_VERSION@
-Requires: champlain- CHAMPLAIN_API_VERSION@ clutter-gtk-0.10 gtk+-3.0
+Requires: champlain- CHAMPLAIN_API_VERSION@ clutter-gtk-1.0 gtk+-3.0
diff --git a/champlain-gtk/gtk-champlain-embed.c b/champlain-gtk/gtk-champlain-embed.c
index a833482..4d44af4 100644
--- a/champlain-gtk/gtk-champlain-embed.c
+++ b/champlain-gtk/gtk-champlain-embed.c
@@ -249,23 +249,37 @@ gtk_champlain_embed_init (GtkChamplainEmbed *embed)
}
+static inline void
+gdk_to_clutter_color (GdkColor *gtk_color,
+ ClutterColor *color)
+{
+ color->red = CLAMP (((gtk_color->red / 65535.0) * 255), 0, 255);
+ color->green = CLAMP (((gtk_color->green / 65535.0) * 255), 0, 255);
+ color->blue = CLAMP (((gtk_color->blue / 65535.0) * 255), 0, 255);
+ color->alpha = 255;
+}
+
+
static void
view_realize_cb (GtkWidget *widget,
GtkChamplainEmbed *view)
{
ClutterColor color = { 0, 0, 0, };
GtkChamplainEmbedPrivate *priv = view->priv;
+ GtkStyle *style;
/* Setup mouse cursor to a hand */
gdk_window_set_cursor (gtk_widget_get_window (priv->clutter_embed), priv->cursor_hand_open);
/* Set selection color */
- gtk_clutter_get_bg_color (GTK_WIDGET (widget), GTK_STATE_SELECTED, &color);
- champlain_marker_set_highlight_color (&color);
+ style = gtk_widget_get_style (widget);
- gtk_clutter_get_text_color (GTK_WIDGET (widget), GTK_STATE_SELECTED, &color);
+ gdk_to_clutter_color (&style->text[GTK_STATE_SELECTED], &color);
champlain_marker_set_highlight_text_color (&color);
+ gdk_to_clutter_color (&style->bg[GTK_STATE_SELECTED], &color);
+ champlain_marker_set_highlight_color (&color);
+
/* To be added later: bg[active] (for selected markers, but focus is on another widget) */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]