[Galago-commits] r2546 - in trunk/notification-daemon: . src themes/standard

galago-commits at freedesktop.org galago-commits at freedesktop.org
Sat Feb 4 13:12:04 PST 2006


Author: chipx86
Date: 2006-02-04 13:12:01 -0800 (Sat, 04 Feb 2006)
New Revision: 2546

Modified:
   trunk/notification-daemon/ChangeLog
   trunk/notification-daemon/src/engines.c
   trunk/notification-daemon/themes/standard/theme.c
Log:
Make more theme functions optional. Fall back to defaults in cases like destroying, showing, or hiding notifications.


Modified: trunk/notification-daemon/ChangeLog
===================================================================
--- trunk/notification-daemon/ChangeLog	2006-02-04 21:08:25 UTC (rev 2545)
+++ trunk/notification-daemon/ChangeLog	2006-02-04 21:12:01 UTC (rev 2546)
@@ -1,3 +1,10 @@
+Sat Feb 04 13:11:25 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/engines.c:
+	* themes/standard/theme.c:
+	  - Make more theme functions optional. Fall back to defaults in cases
+	    like destroying, showing, or hiding notifications.
+
 Sat Feb 04 13:08:02 PST 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* src/daemon.c:

Modified: trunk/notification-daemon/src/engines.c
===================================================================
--- trunk/notification-daemon/src/engines.c	2006-02-04 21:08:25 UTC (rev 2545)
+++ trunk/notification-daemon/src/engines.c	2006-02-04 21:12:01 UTC (rev 2546)
@@ -68,16 +68,17 @@
 	g_module_symbol(engine->module, #name, (gpointer *)&engine->name);
 
 	BIND_REQUIRED_FUNC(create_notification);
-	BIND_REQUIRED_FUNC(destroy_notification);
-	BIND_REQUIRED_FUNC(show_notification);
-	BIND_REQUIRED_FUNC(hide_notification);
-	BIND_REQUIRED_FUNC(set_notification_hints);
 	BIND_REQUIRED_FUNC(set_notification_text);
 	BIND_REQUIRED_FUNC(set_notification_icon);
 	BIND_REQUIRED_FUNC(set_notification_arrow);
 	BIND_REQUIRED_FUNC(add_notification_action);
 	BIND_REQUIRED_FUNC(move_notification);
+
+	BIND_OPTIONAL_FUNC(destroy_notification);
+	BIND_OPTIONAL_FUNC(show_notification);
+	BIND_OPTIONAL_FUNC(hide_notification);
 	BIND_OPTIONAL_FUNC(set_notification_timeout);
+	BIND_OPTIONAL_FUNC(set_notification_hints);
 	BIND_OPTIONAL_FUNC(notification_tick);
 
 	return engine;
@@ -175,28 +176,42 @@
 theme_destroy_notification(GtkWindow *nw)
 {
 	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-	engine->destroy_notification(nw);
+
+	if (engine->destroy_notification != NULL)
+		engine->destroy_notification(nw);
+	else
+		gtk_widget_destroy(GTK_WIDGET(nw));
 }
 
 void
 theme_show_notification(GtkWindow *nw)
 {
 	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-	engine->show_notification(nw);
+
+	if (engine->show_notification != NULL)
+		engine->show_notification(nw);
+	else
+		gtk_widget_show(GTK_WIDGET(nw));
 }
 
 void
 theme_hide_notification(GtkWindow *nw)
 {
 	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-	engine->hide_notification(nw);
+
+	if (engine->hide_notification != NULL)
+		engine->hide_notification(nw);
+	else
+		gtk_widget_hide(GTK_WIDGET(nw));
 }
 
 void
 theme_set_notification_hints(GtkWindow *nw, GHashTable *hints)
 {
 	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
-	engine->set_notification_hints(nw, hints);
+
+	if (engine->set_notification_hints != NULL)
+		engine->set_notification_hints(nw, hints);
 }
 
 void

Modified: trunk/notification-daemon/themes/standard/theme.c
===================================================================
--- trunk/notification-daemon/themes/standard/theme.c	2006-02-04 21:08:25 UTC (rev 2545)
+++ trunk/notification-daemon/themes/standard/theme.c	2006-02-04 21:12:01 UTC (rev 2546)
@@ -300,24 +300,6 @@
 }
 
 void
-destroy_notification(GtkWindow *nw)
-{
-	gtk_widget_destroy(GTK_WIDGET(nw));
-}
-
-void
-show_notification(GtkWindow *nw)
-{
-	gtk_widget_show(GTK_WIDGET(nw));
-}
-
-void
-hide_notification(GtkWindow *nw)
-{
-	gtk_widget_hide(GTK_WIDGET(nw));
-}
-
-void
 set_notification_hints(GtkWindow *nw, GHashTable *hints)
 {
 	WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");



More information about the galago-commits mailing list