* added applet initialization into applet-wrapper
authormishas <mikhail.sobolev@gmail.com>
Sat, 19 Jan 2008 10:32:16 +0000 (10:32 +0000)
committermishas <mikhail.sobolev@gmail.com>
Sat, 19 Jan 2008 10:32:16 +0000 (10:32 +0000)
 * changed the prototype of doInit method (we do not need those parameters any more)
 * removed the code for the old plugin interface

git-svn-id: file:///svnroot/simple-launcher/branches/new-items@265 3ba93dab-e023-0410-b42a-de7732cf370a

applet-wrapper.cc
simple-launcher.cc
simple-launcher.h

index 4d4ec41..baad6ae 100644 (file)
@@ -45,6 +45,7 @@ static void sla_wrapper_init(SLAWrapper *self) {
   self->priv->background_pixmap = NULL;
 
   self->priv->applet = new SimpleLauncherApplet(SL_APPLET_GCONF_PATH);
+  self->priv->applet->doInit();   // FIXME: check the result
 
   if ((colormap = gdk_screen_get_rgba_colormap(gdk_screen_get_default())) != NULL) {
     gtk_widget_set_colormap(GTK_WIDGET(self), colormap);
index 4156691..a9b8a30 100644 (file)
 
 // Hildon home applet interface functions
 
-void *hildon_home_applet_lib_initialize(void *state_data, int *state_size, GtkWidget **widget) {
-  SimpleLauncherApplet *applet = new SimpleLauncherApplet(SL_APPLET_GCONF_PATH);
-
-  if (applet != NULL) {
-    if (applet->doInit(state_data, state_size)) {
-      *widget = applet->getWidget();
-    } else {
-      delete applet;
-      applet = NULL;
-    }
-  }
-
-  return (void*)applet;
-}
-
 void hildon_home_applet_lib_deinitialize(void *applet_data) {
   SimpleLauncherApplet *applet = (SimpleLauncherApplet *)applet_data;
 
@@ -70,7 +55,7 @@ char *SimpleLauncherApplet::ourDirs[] = {
 SimpleLauncherApplet::SimpleLauncherApplet(const std::string& base) : myContext(NULL), myWidget(NULL), myParent(NULL), myValidItems(0), myTransparent(GConfKey(base), "transparent", false), myIconSize(GConfKey(base), "icon_size", 48) {
 }
 
-bool SimpleLauncherApplet::doInit(void *state_data, int *state_size) {
+bool SimpleLauncherApplet::doInit() {
   if ((myContext = osso_initialize(SL_APPLET_DBUS_NAME, SL_APPLET_VERSION, FALSE, NULL)) == NULL) {
     g_debug("sla-applet: failed to initialize the osso layer");
     return false;
index a10fadb..9bd6407 100644 (file)
@@ -32,7 +32,7 @@ public:
   SimpleLauncherApplet(const std::string&);
  ~SimpleLauncherApplet();
 
-  bool doInit(void *state_data, int *state_size);
+  bool doInit();
 
   int saveState(void **state_data, int *state_size);
   GtkWidget *settings(GtkWindow *parent);