[gcompris] Remove custom GC code to support Sugar DBus API to reuse polyol



commit ebdf4147d80839bf74a19dca0d6e718f6dc5e3dc
Author: Aleksey Lim <alsroot sugarlabs org>
Date:   Sat Sep 24 23:26:10 2011 +0000

    Remove custom GC code to support Sugar DBus API to reuse polyol

 configure.ac             |   20 +---------
 src/gcompris/Makefile.am |    3 -
 src/gcompris/dbus.c      |  101 ----------------------------------------------
 src/gcompris/gc_core.h   |    3 -
 src/gcompris/gcompris.c  |   45 --------------------
 5 files changed, 1 insertions(+), 171 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a5858c8..0d0d0d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -422,20 +422,6 @@ AC_ARG_ENABLE(sqlite,
           with_sqlite="$enableval", with_sqlite="yes")
 AC_MSG_RESULT($with_sqlite)
 
-dnl DBUS support (Needed only for OLPC XO)
-AC_MSG_CHECKING([wether we build with DBUS (needed only for OLPC SUGAR XO)])
-AC_ARG_ENABLE(dbus,
-          AC_HELP_STRING(
-          [--enable-dbus],
-          [Turn on dbus (will let GCompris integrate well on OLPC SUGAR XO)]),
-          with_dbus="$enableval", with_dbus="no")
-AC_MSG_RESULT($with_dbus)
-
-if test x$with_dbus = xyes; then
-  PKG_CHECK_MODULES(DBUS, [dbus-1 dbus-glib-1],, AC_MSG_ERROR([*** DBUS not found!]))
-  AC_DEFINE([USE_DBUS], 1,[DBUS support is enabled])
-fi
-
 dnl Sugar DE support
 AC_MSG_CHECKING([wether we build with Sugar DE support])
 AC_ARG_ENABLE(sugar,
@@ -445,10 +431,7 @@ AC_ARG_ENABLE(sugar,
           with_sugar="$enableval", with_sugar="no")
 AC_MSG_RESULT($with_sugar)
 if test x$with_sugar = xyes; then
-  if test x$with_dbus = xno; then
-    AC_MSG_ERROR([You need to add DBUS support as well.])
-  fi
-  PKG_CHECK_MODULES(SUGAR, [sugar-toolkit])
+  PKG_CHECK_MODULES(SUGAR, [polyol-toolkit])
   AC_DEFINE([USE_SUGAR], 1, [Sugar DE support is enabled])
 fi
 AM_CONDITIONAL([SUGAR], [test x$with_sugar = xyes])
@@ -900,7 +883,6 @@ echo "Python plugin                            = $build_python_plugin"
 
 echo "SQLITE database (--enable-sqlite)        = $with_sqlite (profiles depend on this)"
 
-echo "DBUS Support (OLPC XO Sugar)             = $with_dbus"
 echo "Sugar DE Support                         = $with_sugar"
 echo "GNET Networking (--enable-gnet)          = $with_gnet (networking depends on this)"
 echo "BINRELOC (--enable-binreloc)             = $br_cv_binreloc"
diff --git a/src/gcompris/Makefile.am b/src/gcompris/Makefile.am
index 476eb59..cf87969 100644
--- a/src/gcompris/Makefile.am
+++ b/src/gcompris/Makefile.am
@@ -39,7 +39,6 @@ INCLUDES = \
 	-DGNOME_DISABLE_DEPRECATED \
         $(sqlite_cflags) \
 	$(GNET_CFLAGS) \
-	$(DBUS_CFLAGS) \
 	$(AUDIO_CFLAGS) \
 	$(cairo_cflags) \
 	${IGE_MAC_CFLAGS}
@@ -63,7 +62,6 @@ gcompris_SOURCES = \
 	bonus.c \
 	bonus.h \
 	config.c \
-	dbus.c \
 	dialog.c \
 	drag.c \
 	drag.h \
@@ -119,7 +117,6 @@ gcompris_LDFLAGS = \
 gcompris_LDADD = \
 	$(top_builddir)/src/goocanvas/src/libgoocanvas.la \
 	$(GCOMPRIS_LIBS) $(sqlite_ldadd) $(XML_LIBS) $(GNET_LIBS) \
-	$(DBUS_LIBS) \
 	$(AUDIO_LIBS) \
         $(INTLLIBS) \
 	${IGE_MAC_LIBS}
diff --git a/src/gcompris/gc_core.h b/src/gcompris/gc_core.h
index 506fde5..c0e19cf 100644
--- a/src/gcompris/gc_core.h
+++ b/src/gcompris/gc_core.h
@@ -45,7 +45,4 @@ void gc_menu_destroy(void);
 /** log */
 void gc_log_start (GcomprisBoard *gcomprisBoard);
 
-/** dbus */
-void gc_dbus_init(gchar *sugarActivityId);
-
 #endif
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index 76bde26..e5b563e 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -70,8 +70,6 @@ gchar * exec_prefix = NULL;
 //static gint pause_board_cb (GtkWidget *widget, gpointer data);
 static void quit_cb (GtkWidget *widget, gpointer data);
 static void map_cb  (GtkWidget *widget, gpointer data);
-static gboolean _realize_callback (GtkWidget *widget, GdkEventExpose *event,
-				   gpointer data);
 static gint board_widget_key_press_callback (GtkWidget   *widget,
 					    GdkEventKey *event,
 					    gpointer     client_data);
@@ -146,8 +144,6 @@ static gchar *popt_server          = NULL;
 static gint  *popt_web_only        = NULL;
 static gchar *popt_cache_dir       = NULL;
 static gchar *popt_drag_mode       = NULL;
-static gchar *sugarBundleId        = NULL;
-static gchar *sugarActivityId      = NULL;
 static gint popt_sugar_look        = FALSE;
 static gint popt_no_zoom           = FALSE;
 static gint popt_test              = FALSE;
@@ -257,12 +253,6 @@ static GOptionEntry options[] = {
   {"nolockcheck", '\0', 0, G_OPTION_ARG_NONE, &popt_nolockcheck,
    N_("Do not avoid the execution of multiple instances of GCompris."), NULL},
 
-  {"sugarBundleId", '\0', 0, G_OPTION_ARG_STRING, &sugarBundleId,
-   "Sugar Bundle Id", NULL},
-
-  {"sugarActivityId", '\0', 0, G_OPTION_ARG_STRING, &sugarActivityId,
-   "Sugar Activity Id", NULL},
-
   {"sugar",'\0', 0, G_OPTION_ARG_NONE, &popt_sugar_look,
    ("Use Sugar DE look&feel"), NULL},
 
@@ -734,34 +724,6 @@ gc_set_default_background(GooCanvasItem *parent)
 			  "#BACKGROUND");
 }
 
-static gboolean
-_realize_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data)
-{
-#ifdef USE_SUGAR
-  Window xwindow = GDK_WINDOW_XWINDOW(window->window);
-  /*
-   * Sugar requires properties to be set before the windows is realized
-   */
-  if (sugarBundleId)
-    XChangeProperty(GDK_DISPLAY(),
-		    xwindow,
-		    XInternAtom(GDK_DISPLAY(), "_SUGAR_BUNDLE_ID", 0),
-		    XInternAtom(GDK_DISPLAY(), "STRING", 0), 8,
-		    PropModeReplace,
-		    (unsigned char *) sugarBundleId, strlen(sugarBundleId));
-
-  if (sugarActivityId)
-    XChangeProperty(GDK_DISPLAY(),
-		    xwindow,
-		    XInternAtom(GDK_DISPLAY(), "_SUGAR_ACTIVITY_ID", 0),
-		    XInternAtom(GDK_DISPLAY(), "STRING", 0), 8,
-		    PropModeReplace,
-		    (unsigned char *) sugarActivityId, strlen(sugarActivityId));
-#endif
-
-  return FALSE;
-}
-
 static void
 init_workspace()
 {
@@ -883,8 +845,6 @@ static void setup_window ()
 
   gtk_window_set_default_size(GTK_WINDOW(window), BOARDWIDTH, BOARDHEIGHT);
   gtk_window_set_wmclass(GTK_WINDOW(window), "gcompris", "GCompris");
-  g_signal_connect (GTK_OBJECT (window), "realize",
-		    G_CALLBACK (_realize_callback), NULL);
   gtk_widget_realize (window);
 
   g_signal_connect (GTK_OBJECT (window), "delete_event",
@@ -2100,11 +2060,6 @@ main (int argc, char *argv[])
 	gc_sound_play_ogg("voices/$LOCALE/misc/welcome.ogg", NULL);
     }
 
-#ifndef WIN32
-  if (sugarActivityId)
-    gc_dbus_init(sugarActivityId);
-#endif
-
   if (popt_test) {
     gc_test();
   }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]