[notification-daemon] Use consistent indentation



commit e1d188ab518d66d86d788c8a4202807d75e6fa58
Author: William Jon McCann <jmccann redhat com>
Date:   Sat Jan 9 11:34:34 2010 -0500

    Use consistent indentation

 src/daemon/daemon.c  |  237 ++++++++++++++++++++++++++------------------------
 src/daemon/daemon.h  |   34 ++++----
 src/daemon/engines.c |   45 ++++++----
 src/daemon/engines.h |   19 +++--
 src/daemon/stack.c   |   53 ++++++-----
 src/daemon/stack.h   |   19 +++--
 6 files changed, 219 insertions(+), 188 deletions(-)
---
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index 0740e0f..cfe1f4a 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -121,19 +121,19 @@ struct _DBusGMethodInvocation
 static void notify_daemon_finalize(GObject *object);
 static void _notification_destroyed_cb(GtkWindow *nw, NotifyDaemon *daemon);
 static void _close_notification(NotifyDaemon *daemon, guint id,
-								gboolean hide_notification,
-								NotifydClosedReason reason);
+				gboolean hide_notification,
+				NotifydClosedReason reason);
 static GdkFilterReturn _notify_x11_filter(GdkXEvent *xevent,
-										  GdkEvent *event,
-										  gpointer user_data);
+					  GdkEvent *event,
+					  gpointer user_data);
 static void _emit_closed_signal(GtkWindow *nw, NotifydClosedReason reason);
 static void _action_invoked_cb(GtkWindow *nw, const char *key);
 static NotifyStackLocation get_stack_location_from_string(const char *slocation);
 static void sync_notification_position(NotifyDaemon *daemon, GtkWindow *nw,
-									   Window source);
+				       Window source);
 static void monitor_notification_source_windows(NotifyDaemon *daemon,
-												NotifyTimeout *nt,
-												Window source);
+						NotifyTimeout *nt,
+						Window source);
 
 G_DEFINE_TYPE(NotifyDaemon, notify_daemon, G_TYPE_OBJECT);
 
@@ -156,7 +156,7 @@ _notify_timeout_destroy(NotifyTimeout *nt)
 	 * destroyed.
 	 */
 	g_signal_handlers_disconnect_by_func(nt->nw, _notification_destroyed_cb,
-										 nt->daemon);
+					     nt->daemon);
 
 	gtk_widget_destroy(GTK_WIDGET(nt->nw));
 	g_free(nt);
@@ -214,7 +214,7 @@ notify_daemon_init(NotifyDaemon *daemon)
 	daemon->priv->monitored_window_hash = g_hash_table_new(NULL, NULL);
 	daemon->priv->notification_hash =
 		g_hash_table_new_full(g_int_hash, g_int_equal, g_free,
-				  (GDestroyNotify)_notify_timeout_destroy);
+				      (GDestroyNotify)_notify_timeout_destroy);
 }
 
 static void
@@ -247,8 +247,8 @@ get_stack_location_from_string(const char *slocation)
 		const PopupNotifyStackLocation *l;
 
 		for (l = popup_stack_locations;
-			 l->type != NOTIFY_STACK_LOCATION_UNKNOWN;
-			 l++)
+		     l->type != NOTIFY_STACK_LOCATION_UNKNOWN;
+		     l++)
 		{
 			if (!strcmp(slocation, l->identifier))
 				stack_location = l->type;
@@ -268,13 +268,13 @@ create_signal(GtkWindow *nw, const char *signal_name)
 	g_assert(dest != NULL);
 
 	message = dbus_message_new_signal("/org/freedesktop/Notifications",
-									  "org.freedesktop.Notifications",
-									  signal_name);
+					  "org.freedesktop.Notifications",
+					  signal_name);
 
 	dbus_message_set_destination(message, dest);
 	dbus_message_append_args(message,
-							 DBUS_TYPE_UINT32, &id,
-							 DBUS_TYPE_INVALID);
+				 DBUS_TYPE_UINT32, &id,
+				 DBUS_TYPE_INVALID);
 
 	return message;
 }
@@ -288,8 +288,8 @@ _action_invoked_cb(GtkWindow *nw, const char *key)
 
 	message = create_signal(nw, "ActionInvoked");
 	dbus_message_append_args(message,
-							 DBUS_TYPE_STRING, &key,
-							 DBUS_TYPE_INVALID);
+				 DBUS_TYPE_STRING, &key,
+				 DBUS_TYPE_INVALID);
 
 	dbus_connection_send(dbus_conn, message, NULL);
 	dbus_message_unref(message);
@@ -302,15 +302,17 @@ _emit_closed_signal(GtkWindow *nw, NotifydClosedReason reason)
 {
 	DBusMessage *message = create_signal(nw, "NotificationClosed");
 	dbus_message_append_args(message,
-							 DBUS_TYPE_UINT32, &reason,
-							 DBUS_TYPE_INVALID);
+				 DBUS_TYPE_UINT32, &reason,
+				 DBUS_TYPE_INVALID);
 	dbus_connection_send(dbus_conn, message, NULL);
 	dbus_message_unref(message);
 }
 
 static void
-_close_notification(NotifyDaemon *daemon, guint id,
-					gboolean hide_notification, NotifydClosedReason reason)
+_close_notification(NotifyDaemon *daemon,
+		    guint id,
+		    gboolean hide_notification,
+		    NotifydClosedReason reason)
 {
 	NotifyDaemonPrivate *priv = daemon->priv;
 	NotifyTimeout *nt;
@@ -336,7 +338,7 @@ _notification_destroyed_cb(GtkWindow *nw, NotifyDaemon *daemon)
 	 * all notifications are closed. Mark them as expired.
 	 */
 	_close_notification(daemon, NW_GET_NOTIFY_ID(nw), FALSE,
-						NOTIFYD_CLOSED_EXPIRED);
+			    NOTIFYD_CLOSED_EXPIRED);
 }
 
 typedef struct
@@ -357,13 +359,13 @@ idle_reposition_notification(gpointer datap)
 
 	/* Look up the timeout, if it's completed we don't need to do anything */
 	nt = (NotifyTimeout *)g_hash_table_lookup(daemon->priv->notification_hash,
-											  &notify_id);
+						  &notify_id);
 	if (nt != NULL) {
 		sync_notification_position(daemon, nt->nw, nt->src_window_xid);
 	}
 
 	g_hash_table_remove(daemon->priv->idle_reposition_notify_ids,
-						GINT_TO_POINTER(notify_id));
+			    GINT_TO_POINTER(notify_id));
 	g_object_unref(daemon);
 	g_free(data);
 
@@ -380,8 +382,8 @@ _queue_idle_reposition_notification(NotifyDaemon *daemon, gint notify_id)
 
 	/* Do we already have an idle update pending? */
 	if (g_hash_table_lookup_extended(daemon->priv->idle_reposition_notify_ids,
-									 GINT_TO_POINTER(notify_id),
-									 &orig_key, &value))
+					 GINT_TO_POINTER(notify_id),
+					 &orig_key, &value))
 	{
 		return;
 	}
@@ -392,15 +394,15 @@ _queue_idle_reposition_notification(NotifyDaemon *daemon, gint notify_id)
 
 	/* We do this as a short timeout to avoid repositioning spam */
 	idle_id = g_timeout_add_full(G_PRIORITY_LOW, 50,
-								 idle_reposition_notification, data, NULL);
+				     idle_reposition_notification, data, NULL);
 	g_hash_table_insert(daemon->priv->idle_reposition_notify_ids,
-						GINT_TO_POINTER(notify_id), GUINT_TO_POINTER(idle_id));
+			    GINT_TO_POINTER(notify_id), GUINT_TO_POINTER(idle_id));
 }
 
 static GdkFilterReturn
 _notify_x11_filter(GdkXEvent *xevent,
-				   GdkEvent *event,
-				   gpointer user_data)
+		   GdkEvent *event,
+		   gpointer user_data)
 {
 	NotifyDaemon *daemon = NOTIFY_DAEMON(user_data);
 	XEvent *xev = (XEvent *)xevent;
@@ -412,14 +414,14 @@ _notify_x11_filter(GdkXEvent *xevent,
 	if (xev->xany.type == DestroyNotify)
 	{
 		g_hash_table_remove(daemon->priv->monitored_window_hash,
-							GUINT_TO_POINTER(xev->xany.window));
+				    GUINT_TO_POINTER(xev->xany.window));
 		if (g_hash_table_size(daemon->priv->monitored_window_hash) == 0)
 			gdk_window_remove_filter(NULL, _notify_x11_filter, daemon);
 		return GDK_FILTER_CONTINUE;
 	}
 
 	if (!g_hash_table_lookup_extended(daemon->priv->monitored_window_hash,
-					 GUINT_TO_POINTER(xev->xany.window), &orig_key, &value))
+					  GUINT_TO_POINTER(xev->xany.window), &orig_key, &value))
 		return GDK_FILTER_CONTINUE;
 
 	notify_id = GPOINTER_TO_INT(value);
@@ -430,8 +432,7 @@ _notify_x11_filter(GdkXEvent *xevent,
 	}
 	else if (xev->xany.type == ReparentNotify)
 	{
-		nt = (NotifyTimeout *)g_hash_table_lookup(
-			daemon->priv->notification_hash, &notify_id);
+		nt = (NotifyTimeout *)g_hash_table_lookup(daemon->priv->notification_hash, &notify_id);
 
 		if (nt == NULL)
 			return GDK_FILTER_CONTINUE;
@@ -448,7 +449,9 @@ _notify_x11_filter(GdkXEvent *xevent,
 }
 
 static void
-_mouse_entered_cb(GtkWindow *nw, GdkEventCrossing *event, NotifyDaemon *daemon)
+_mouse_entered_cb(GtkWindow *nw,
+		  GdkEventCrossing *event,
+		  NotifyDaemon *daemon)
 {
 	NotifyTimeout *nt;
 	guint id;
@@ -459,7 +462,7 @@ _mouse_entered_cb(GtkWindow *nw, GdkEventCrossing *event, NotifyDaemon *daemon)
 
 	id = NW_GET_NOTIFY_ID(nw);
 	nt = (NotifyTimeout *)g_hash_table_lookup(daemon->priv->notification_hash,
-											  &id);
+						  &id);
 
 	nt->paused = TRUE;
 	g_get_current_time(&now);
@@ -475,8 +478,9 @@ _mouse_entered_cb(GtkWindow *nw, GdkEventCrossing *event, NotifyDaemon *daemon)
 }
 
 static void
-_mouse_exitted_cb(GtkWindow *nw, GdkEventCrossing *event,
-				  NotifyDaemon *daemon)
+_mouse_exitted_cb(GtkWindow *nw,
+		  GdkEventCrossing *event,
+		  NotifyDaemon *daemon)
 {
 	NotifyTimeout *nt;
 	guint id;
@@ -486,7 +490,7 @@ _mouse_exitted_cb(GtkWindow *nw, GdkEventCrossing *event,
 
 	id = NW_GET_NOTIFY_ID(nw);
 	nt = (NotifyTimeout *)g_hash_table_lookup(daemon->priv->notification_hash,
-											  &id);
+						  &id);
 
 	nt->paused = FALSE;
 }
@@ -543,7 +547,7 @@ _check_expiration(gpointer data)
 	gboolean has_more_timeouts = FALSE;
 
 	g_hash_table_foreach_remove(daemon->priv->notification_hash,
-								_is_expired, (gpointer)&has_more_timeouts);
+				    _is_expired, (gpointer)&has_more_timeouts);
 
 	if (!has_more_timeouts)
 		daemon->priv->timeout_source = 0;
@@ -617,14 +621,15 @@ _store_notification(NotifyDaemon *daemon, GtkWindow *nw, int timeout)
 	_calculate_timeout(daemon, nt, timeout);
 
 	g_hash_table_insert(priv->notification_hash,
-						g_memdup(&id, sizeof(guint)), nt);
+			    g_memdup(&id, sizeof(guint)), nt);
 
 	return nt;
 }
 
 static gboolean
-_notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
-								 GValue *icon_data)
+_notify_daemon_process_icon_data(NotifyDaemon *daemon,
+				 GtkWindow *nw,
+				 GValue *icon_data)
 {
 	const guchar *data = NULL;
 	gboolean has_alpha;
@@ -641,21 +646,20 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 #if CHECK_DBUS_VERSION(0, 61)
 	GType struct_type;
 
-	struct_type = dbus_g_type_get_struct(
-		"GValueArray",
-		G_TYPE_INT,
-		G_TYPE_INT,
-		G_TYPE_INT,
-		G_TYPE_BOOLEAN,
-		G_TYPE_INT,
-		G_TYPE_INT,
-		dbus_g_type_get_collection("GArray", G_TYPE_UCHAR),
-		G_TYPE_INVALID);
+	struct_type = dbus_g_type_get_struct("GValueArray",
+					     G_TYPE_INT,
+					     G_TYPE_INT,
+					     G_TYPE_INT,
+					     G_TYPE_BOOLEAN,
+					     G_TYPE_INT,
+					     G_TYPE_INT,
+					     dbus_g_type_get_collection("GArray", G_TYPE_UCHAR),
+					     G_TYPE_INVALID);
 
 	if (!G_VALUE_HOLDS(icon_data, struct_type))
 	{
 		g_warning("_notify_daemon_process_icon_data expected a "
-				  "GValue of type GValueArray");
+			  "GValue of type GValueArray");
 		return FALSE;
 	}
 #endif /* D-BUS >= 0.61 */
@@ -666,14 +670,14 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 	if (value == NULL)
 	{
 		g_warning("_notify_daemon_process_icon_data expected position "
-				  "0 of the GValueArray to exist");
+			  "0 of the GValueArray to exist");
 		return FALSE;
 	}
 
 	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 0 of the GValueArray to be of type int");
+			  "position 0 of the GValueArray to be of type int");
 		return FALSE;
 	}
 
@@ -683,14 +687,14 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 	if (value == NULL)
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 1 of the GValueArray to exist");
+			  "position 1 of the GValueArray to exist");
 		return FALSE;
 	}
 
 	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 1 of the GValueArray to be of type int");
+			  "position 1 of the GValueArray to be of type int");
 		return FALSE;
 	}
 
@@ -700,14 +704,14 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 	if (value == NULL)
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 2 of the GValueArray to exist");
+			  "position 2 of the GValueArray to exist");
 		return FALSE;
 	}
 
 	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 2 of the GValueArray to be of type int");
+			  "position 2 of the GValueArray to be of type int");
 		return FALSE;
 	}
 
@@ -717,14 +721,14 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 	if (value == NULL)
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 3 of the GValueArray to exist");
+			  "position 3 of the GValueArray to exist");
 		return FALSE;
 	}
 
 	if (!G_VALUE_HOLDS(value, G_TYPE_BOOLEAN))
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 3 of the GValueArray to be of type gboolean");
+			  "position 3 of the GValueArray to be of type gboolean");
 		return FALSE;
 	}
 
@@ -734,14 +738,14 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 	if (value == NULL)
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 4 of the GValueArray to exist");
+			  "position 4 of the GValueArray to exist");
 		return FALSE;
 	}
 
 	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 4 of the GValueArray to be of type int");
+			  "position 4 of the GValueArray to be of type int");
 		return FALSE;
 	}
 
@@ -751,14 +755,14 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 	if (value == NULL)
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 5 of the GValueArray to exist");
+			  "position 5 of the GValueArray to exist");
 		return FALSE;
 	}
 
 	if (!G_VALUE_HOLDS(value, G_TYPE_INT))
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 5 of the GValueArray to be of type int");
+			  "position 5 of the GValueArray to be of type int");
 		return FALSE;
 	}
 
@@ -768,15 +772,15 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 	if (value == NULL)
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 6 of the GValueArray to exist");
+			  "position 6 of the GValueArray to exist");
 		return FALSE;
 	}
 
 	if (!G_VALUE_HOLDS(value,
-					   dbus_g_type_get_collection("GArray", G_TYPE_UCHAR)))
+			   dbus_g_type_get_collection("GArray", G_TYPE_UCHAR)))
 	{
 		g_warning("_notify_daemon_process_icon_data expected "
-				  "position 6 of the GValueArray to be of type GArray");
+			  "position 6 of the GValueArray to be of type GArray");
 		return FALSE;
 	}
 
@@ -787,9 +791,9 @@ _notify_daemon_process_icon_data(NotifyDaemon *daemon, GtkWindow *nw,
 	if (expected_len != tmp_array->len)
 	{
 		g_warning("_notify_daemon_process_icon_data expected image "
-				  "data to be of length %" G_GSIZE_FORMAT " but got a "
-				  "length of %u",
-				  expected_len, tmp_array->len);
+			  "data to be of length %" G_GSIZE_FORMAT " but got a "
+			  "length of %u",
+			  expected_len, tmp_array->len);
 		return FALSE;
 	}
 
@@ -816,12 +820,14 @@ window_clicked_cb(GtkWindow *nw, GdkEventButton *button, NotifyDaemon *daemon)
 
 	_action_invoked_cb(nw, "default");
 	_close_notification(daemon, NW_GET_NOTIFY_ID(nw), TRUE,
-						NOTIFYD_CLOSED_USER);
+			    NOTIFYD_CLOSED_USER);
 }
 
 static void
-popup_location_changed_cb(GConfClient *client, guint cnxn_id,
-						  GConfEntry *entry, gpointer user_data)
+popup_location_changed_cb(GConfClient *client,
+			  guint cnxn_id,
+			  GConfEntry *entry,
+			  gpointer user_data)
 {
 	NotifyDaemon *daemon = (NotifyDaemon*)user_data;
 	NotifyStackLocation stack_location;
@@ -842,9 +848,9 @@ popup_location_changed_cb(GConfClient *client, guint cnxn_id,
 	else
 	{
 		gconf_client_set_string(get_gconf_client(),
-			"/apps/notification-daemon/popup_location",
-			popup_stack_locations[POPUP_STACK_DEFAULT_INDEX].identifier,
-			NULL);
+					"/apps/notification-daemon/popup_location",
+					popup_stack_locations[POPUP_STACK_DEFAULT_INDEX].identifier,
+					NULL);
 
 		stack_location = NOTIFY_STACK_LOCATION_DEFAULT;
 	}
@@ -943,14 +949,14 @@ fullscreen_window_exists(GtkWidget *nw)
 	wnck_workspace = wnck_screen_get_active_workspace(wnck_screen);
 
 	for (l = wnck_screen_get_windows_stacked(wnck_screen);
-		 l != NULL;
-		 l = l->next)
+	     l != NULL;
+	     l = l->next)
 	{
 		WnckWindow *wnck_win = (WnckWindow *)l->data;
 
 		if (wnck_window_is_on_workspace(wnck_win, wnck_workspace) &&
-			wnck_window_is_fullscreen(wnck_win) &&
-			wnck_window_is_active(wnck_win))
+		    wnck_window_is_fullscreen(wnck_win) &&
+		    wnck_window_is_active(wnck_win))
 		{
 			/*
 			 * Sanity check if the window is _really_ fullscreen to
@@ -973,8 +979,8 @@ fullscreen_window_exists(GtkWidget *nw)
 
 static Window
 get_window_parent(Display *display,
-				  Window window,
-				  Window *root)
+		  Window window,
+		  Window *root)
 {
 	Window parent;
 	Window *children = NULL;
@@ -998,8 +1004,8 @@ get_window_parent(Display *display,
  */
 static void
 monitor_notification_source_windows(NotifyDaemon *daemon,
-									NotifyTimeout *nt,
-									Window source)
+				    NotifyTimeout *nt,
+				    Window source)
 {
 	Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
 	Window root = None;
@@ -1027,8 +1033,8 @@ monitor_notification_source_windows(NotifyDaemon *daemon,
 /* Use a source X Window ID to reposition a notification. */
 static void
 sync_notification_position(NotifyDaemon *daemon,
-						   GtkWindow *nw,
-						   Window source)
+			   GtkWindow *nw,
+			   Window source)
 {
 	Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
 	Status result;
@@ -1042,7 +1048,7 @@ sync_notification_position(NotifyDaemon *daemon,
 
 	/* Get the root for this window */
 	result = XGetGeometry(display, source, &root, &x, &y,
-						  &width, &height, &border_width, &depth);
+			      &width, &height, &border_width, &depth);
 	if (gdk_error_trap_pop() || !result)
 		return;
 
@@ -1052,7 +1058,7 @@ sync_notification_position(NotifyDaemon *daemon,
 	 */
 	gdk_error_trap_push ();
 	result = XTranslateCoordinates(display, source, root, 0, 0,
-								   &x, &y, &child);
+				       &x, &y, &child);
 	if (gdk_error_trap_pop() || !result)
 		return;
 
@@ -1085,14 +1091,15 @@ notify_daemon_error_quark(void)
 
 gboolean
 notify_daemon_notify_handler(NotifyDaemon *daemon,
-							 const gchar *app_name,
-							 guint id,
-							 const gchar *icon,
-							 const gchar *summary,
-							 const gchar *body,
-							 gchar **actions,
-							 GHashTable *hints,
-							 int timeout, DBusGMethodInvocation *context)
+			     const gchar *app_name,
+			     guint id,
+			     const gchar *icon,
+			     const gchar *summary,
+			     const gchar *body,
+			     gchar **actions,
+			     GHashTable *hints,
+			     int timeout,
+			     DBusGMethodInvocation *context)
 {
 	NotifyDaemonPrivate *priv = daemon->priv;
 	NotifyTimeout *nt = NULL;
@@ -1128,13 +1135,13 @@ notify_daemon_notify_handler(NotifyDaemon *daemon,
 		new_notification = TRUE;
 
 		g_signal_connect(G_OBJECT(nw), "button-release-event",
-						 G_CALLBACK(window_clicked_cb), daemon);
+				 G_CALLBACK(window_clicked_cb), daemon);
 		g_signal_connect(G_OBJECT(nw), "destroy",
-						 G_CALLBACK(_notification_destroyed_cb), daemon);
+				 G_CALLBACK(_notification_destroyed_cb), daemon);
 		g_signal_connect(G_OBJECT(nw), "enter-notify-event",
-						 G_CALLBACK(_mouse_entered_cb), daemon);
+				 G_CALLBACK(_mouse_entered_cb), daemon);
 		g_signal_connect(G_OBJECT(nw), "leave-notify-event",
-						 G_CALLBACK(_mouse_exitted_cb), daemon);
+				 G_CALLBACK(_mouse_exitted_cb), daemon);
 	}
 	else
 	{
@@ -1179,7 +1186,7 @@ notify_daemon_notify_handler(NotifyDaemon *daemon,
 		else
 		{
 			g_warning("suppress-sound is of type %s (expected bool or int)\n",
-					  g_type_name(G_VALUE_TYPE(data)));
+				  g_type_name(G_VALUE_TYPE(data)));
 		}
 	}
 
@@ -1208,8 +1215,8 @@ notify_daemon_notify_handler(NotifyDaemon *daemon,
 		if (l == NULL)
 		{
 			g_warning("Label not found for action %s. "
-					  "The protocol specifies that a label must "
-					  "follow an action in the actions array", actions[i]);
+				  "The protocol specifies that a label must "
+				  "follow an action in the actions array", actions[i]);
 
 			break;
 		}
@@ -1252,7 +1259,7 @@ notify_daemon_notify_handler(NotifyDaemon *daemon,
 			if (icon_info != NULL)
 			{
 				gint icon_size = MIN(IMAGE_SIZE,
-									 gtk_icon_info_get_base_size(icon_info));
+						     gtk_icon_info_get_base_size(icon_info));
 
 				if (icon_size == 0)
 					icon_size = IMAGE_SIZE;
@@ -1351,9 +1358,9 @@ notify_daemon_notify_handler(NotifyDaemon *daemon,
 #endif
 
 	g_object_set_data(G_OBJECT(nw), "_notify_id",
-					  GUINT_TO_POINTER(return_id));
+			  GUINT_TO_POINTER(return_id));
 	g_object_set_data_full(G_OBJECT(nw), "_notify_sender", sender,
-						   (GDestroyNotify)g_free);
+			       (GDestroyNotify)g_free);
 
 	if (nt)
 		_calculate_timeout(daemon, nt, timeout);
@@ -1370,7 +1377,7 @@ notify_daemon_close_notification_handler(NotifyDaemon *daemon,
 	if (id == 0)
 	{
 		g_set_error(error, notify_daemon_error_quark(), 100,
-					_("%u is not a valid notification ID"), id);
+			    _("%u is not a valid notification ID"), id);
 		return FALSE;
 	} else {
 		_close_notification(daemon, id, TRUE, NOTIFYD_CLOSED_API);
@@ -1430,7 +1437,7 @@ main(int argc, char **argv)
 
 	gconf_client = gconf_client_get_default();
 	gconf_client_add_dir(gconf_client, GCONF_KEY_DAEMON,
-						 GCONF_CLIENT_PRELOAD_NONE, NULL);
+			     GCONF_CLIENT_PRELOAD_NONE, NULL);
 
 	error = NULL;
 
@@ -1455,11 +1462,11 @@ main(int argc, char **argv)
 										  "org.freedesktop.DBus");
 
 	if (!dbus_g_proxy_call(bus_proxy, "RequestName", &error,
-						   G_TYPE_STRING, "org.freedesktop.Notifications",
-						   G_TYPE_UINT, 0,
-						   G_TYPE_INVALID,
-						   G_TYPE_UINT, &request_name_result,
-						   G_TYPE_INVALID))
+			       G_TYPE_STRING, "org.freedesktop.Notifications",
+			       G_TYPE_UINT, 0,
+			       G_TYPE_INVALID,
+			       G_TYPE_UINT, &request_name_result,
+			       G_TYPE_INVALID))
 	{
 		g_error("Could not aquire name: %s", error->message);
 	}
diff --git a/src/daemon/daemon.h b/src/daemon/daemon.h
index 60b4cc7..8bd61ce 100644
--- a/src/daemon/daemon.h
+++ b/src/daemon/daemon.h
@@ -1,4 +1,5 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
  * daemon.h - Implementation of the destop notification spec
  *
  * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
@@ -89,27 +90,28 @@ GType notify_daemon_get_type(void);
 GQuark notify_daemon_error_quark(void);
 
 gboolean notify_daemon_notify_handler(NotifyDaemon *daemon,
-									  const gchar *app_name,
-									  guint id,
-									  const gchar *icon,
-									  const gchar *summary,
-									  const gchar *body,
-									  gchar **actions,
-									  GHashTable *hints,
-									  int timeout,
-									  DBusGMethodInvocation *context);
+				      const gchar *app_name,
+				      guint id,
+				      const gchar *icon,
+				      const gchar *summary,
+				      const gchar *body,
+				      gchar **actions,
+				      GHashTable *hints,
+				      int timeout,
+				      DBusGMethodInvocation *context);
 
 gboolean notify_daemon_close_notification_handler(NotifyDaemon *daemon,
-												  guint id, GError **error);
+						  guint id,
+						  GError **error);
 
 gboolean notify_daemon_get_capabilities(NotifyDaemon *daemon,
-										char ***out_caps);
+					char ***out_caps);
 
 gboolean notify_daemon_get_server_information(NotifyDaemon *daemon,
-											  char **out_name,
-											  char **out_vendor,
-											  char **out_version,
-											  char **out_spec_ver);
+					      char **out_name,
+					      char **out_vendor,
+					      char **out_version,
+					      char **out_spec_ver);
 
 GConfClient *get_gconf_client(void);
 
diff --git a/src/daemon/engines.c b/src/daemon/engines.c
index 16c81bb..31e0b33 100644
--- a/src/daemon/engines.c
+++ b/src/daemon/engines.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 #include "config.h"
 
 #include <gconf/gconf-client.h>
@@ -10,22 +12,24 @@ typedef struct
 	guint ref_count;
 
 	gboolean (*theme_check_init)(unsigned int major_ver,
-								 unsigned int minor_ver,
-								 unsigned int micro_ver);
-	void (*get_theme_info)(char **theme_name, char **theme_ver,
-						   char **author, char **homepage);
+				     unsigned int minor_ver,
+				     unsigned int micro_ver);
+	void (*get_theme_info)(char **theme_name,
+			       char **theme_ver,
+			       char **author,
+			       char **homepage);
 	GtkWindow *(*create_notification)(UrlClickedCb url_clicked_cb);
 	void (*destroy_notification)(GtkWindow *nw);
 	void (*show_notification)(GtkWindow *nw);
 	void (*hide_notification)(GtkWindow *nw);
 	void (*set_notification_hints)(GtkWindow *nw, GHashTable *hints);
 	void (*set_notification_text)(GtkWindow *nw, const char *summary,
-								  const char *body);
+                                      const char *body);
 	void (*set_notification_icon)(GtkWindow *nw, GdkPixbuf *pixbuf);
 	void (*set_notification_arrow)(GtkWindow *nw, gboolean visible,
-								   int x, int y);
+                                       int x, int y);
 	void (*add_notification_action)(GtkWindow *nw, const char *label,
-									const char *key, GCallback cb);
+                                        const char *key, GCallback cb);
 	void (*clear_notification_actions)(GtkWindow *nw);
 	void (*move_notification)(GtkWindow *nw, int x, int y);
 	void (*set_notification_timeout)(GtkWindow *nw, glong timeout);
@@ -87,8 +91,8 @@ load_theme_engine(const char *name)
 	BIND_OPTIONAL_FUNC(get_always_stack);
 
 	if (!engine->theme_check_init(NOTIFICATION_DAEMON_MAJOR_VERSION,
-								  NOTIFICATION_DAEMON_MINOR_VERSION,
-								  NOTIFICATION_DAEMON_MICRO_VERSION))
+				      NOTIFICATION_DAEMON_MINOR_VERSION,
+				      NOTIFICATION_DAEMON_MICRO_VERSION))
 	{
 		g_warning("Theme doesn't work with this version of notification-daemon");
 		goto error;
@@ -140,8 +144,10 @@ theme_engine_unref(ThemeEngine *engine)
 }
 
 static void
-theme_changed_cb(GConfClient *client, guint cnxn_id, GConfEntry *entry,
-				 gpointer user_data)
+theme_changed_cb(GConfClient *client,
+		 guint cnxn_id,
+		 GConfEntry *entry,
+		 gpointer user_data)
 {
 	if (active_engine == NULL)
 		return;
@@ -164,8 +170,8 @@ get_theme_engine(void)
 		if (theme_prop_notify_id == 0)
 		{
 			theme_prop_notify_id = gconf_client_notify_add(client,
-				"/apps/notification-daemon/theme", theme_changed_cb, NULL,
-				NULL, NULL);
+								       "/apps/notification-daemon/theme", theme_changed_cb, NULL,
+								       NULL, NULL);
 		}
 
 		if (enginename == NULL)
@@ -198,7 +204,7 @@ theme_create_notification(UrlClickedCb url_clicked_cb)
 	ThemeEngine *engine = get_theme_engine();
 	GtkWindow *nw = engine->create_notification(url_clicked_cb);
 	g_object_set_data_full(G_OBJECT(nw), "_theme_engine", engine,
-						   (GDestroyNotify)theme_engine_unref);
+			       (GDestroyNotify)theme_engine_unref);
 	engine->ref_count++;
 	return nw;
 }
@@ -264,8 +270,9 @@ theme_notification_tick(GtkWindow *nw, glong remaining)
 }
 
 void
-theme_set_notification_text(GtkWindow *nw, const char *summary,
-							const char *body)
+theme_set_notification_text(GtkWindow *nw,
+                            const char *summary,
+                            const char *body)
 {
 	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
 	engine->set_notification_text(nw, summary, body);
@@ -286,8 +293,10 @@ theme_set_notification_arrow(GtkWindow *nw, gboolean visible, int x, int y)
 }
 
 void
-theme_add_notification_action(GtkWindow *nw, const char *label,
-							  const char *key, GCallback cb)
+theme_add_notification_action(GtkWindow *nw,
+			      const char *label,
+			      const char *key,
+			      GCallback cb)
 {
 	ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
 	engine->add_notification_action(nw, label, key, cb);
diff --git a/src/daemon/engines.h b/src/daemon/engines.h
index 1cf50dc..8f875c0 100644
--- a/src/daemon/engines.h
+++ b/src/daemon/engines.h
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 #ifndef _ENGINES_H_
 #define _ENGINES_H_
 
@@ -12,13 +14,18 @@ void theme_hide_notification(GtkWindow *nw);
 void theme_set_notification_hints(GtkWindow *nw, GHashTable *hints);
 void theme_set_notification_timeout(GtkWindow *nw, glong timeout);
 void theme_notification_tick(GtkWindow *nw, glong remaining);
-void theme_set_notification_text(GtkWindow *nw, const char *summary,
-								 const char *body);
+void theme_set_notification_text(GtkWindow *nw,
+				 const char *summary,
+				 const char *body);
 void theme_set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf);
-void theme_set_notification_arrow(GtkWindow *nw, gboolean visible,
-								  int x, int y);
-void theme_add_notification_action(GtkWindow *nw, const char *label,
-								   const char *key, GCallback cb);
+void theme_set_notification_arrow(GtkWindow *nw,
+				  gboolean visible,
+				  int x,
+				  int y);
+void theme_add_notification_action(GtkWindow *nw,
+				   const char *label,
+				   const char *key,
+				   GCallback cb);
 void theme_clear_notification_actions(GtkWindow *nw);
 void theme_move_notification(GtkWindow *nw, int x, int y);
 gboolean theme_get_always_stack(GtkWindow *nw);
diff --git a/src/daemon/stack.c b/src/daemon/stack.c
index ee70d08..2ad65df 100644
--- a/src/daemon/stack.c
+++ b/src/daemon/stack.c
@@ -70,9 +70,9 @@ get_work_area(GtkWidget *nw, GdkRectangle *rect)
 
 	win = XRootWindow(GDK_DISPLAY(), disp_screen);
 	result = XGetWindowProperty(GDK_DISPLAY(), win, workarea, 0,
-								max_len, False, AnyPropertyType,
-								&type, &format, &num, &leftovers,
-								&ret_workarea);
+				    max_len, False, AnyPropertyType,
+				    &type, &format, &num, &leftovers,
+				    &ret_workarea);
 
 	if (result != Success || type == None || format == 0 || leftovers ||
 		num % 4)
@@ -93,9 +93,10 @@ get_work_area(GtkWidget *nw, GdkRectangle *rect)
 
 static void
 get_origin_coordinates(NotifyStackLocation stack_location,
-					   GdkRectangle *workarea,
-					   gint *x, gint *y, gint *shiftx, gint *shifty,
-					   gint width, gint height)
+		       GdkRectangle *workarea,
+		       gint *x, gint *y,
+		       gint *shiftx, gint *shifty,
+		       gint width, gint height)
 {
 	switch (stack_location)
 	{
@@ -128,9 +129,11 @@ get_origin_coordinates(NotifyStackLocation stack_location,
 
 static void
 translate_coordinates(NotifyStackLocation stack_location,
-					  GdkRectangle *workarea,
-					  gint *x, gint *y, gint *shiftx, gint *shifty,
-					  gint width, gint height, gint index)
+		      GdkRectangle *workarea,
+		      gint *x, gint *y,
+		      gint *shiftx, gint *shifty,
+		      gint width, gint height,
+		      gint index)
 {
 	switch (stack_location)
 	{
@@ -163,9 +166,9 @@ translate_coordinates(NotifyStackLocation stack_location,
 
 NotifyStack *
 notify_stack_new(NotifyDaemon *daemon,
-				 GdkScreen *screen,
-				 guint monitor,
-				 NotifyStackLocation location)
+		 GdkScreen *screen,
+		 guint monitor,
+		 NotifyStackLocation location)
 {
 	NotifyStack *stack;
 
@@ -194,19 +197,19 @@ notify_stack_destroy(NotifyStack *stack)
 
 void
 notify_stack_set_location(NotifyStack *stack,
-						  NotifyStackLocation location)
+			  NotifyStackLocation location)
 {
 	stack->location = location;
 }
 
 static void
 notify_stack_shift_notifications(NotifyStack *stack,
-								 GtkWindow *nw,
-								 GSList **nw_l,
-								 gint init_width,
-								 gint init_height,
-								 gint *nw_x,
-								 gint *nw_y)
+				 GtkWindow *nw,
+				 GSList **nw_l,
+				 gint init_width,
+				 gint init_height,
+				 gint *nw_x,
+				 gint *nw_y)
 {
 	GdkRectangle workarea;
 	GdkRectangle monitor;
@@ -218,7 +221,7 @@ notify_stack_shift_notifications(NotifyStack *stack,
 	gdk_rectangle_intersect (&monitor, &workarea, &workarea);
 
 	get_origin_coordinates(stack->location, &workarea, &x, &y,
-						   &shiftx, &shifty, init_width, init_height);
+			       &shiftx, &shifty, init_width, init_height);
 
 	if (nw_x != NULL)
 		*nw_x = x;
@@ -249,8 +252,8 @@ notify_stack_shift_notifications(NotifyStack *stack,
 
 void
 notify_stack_add_window(NotifyStack *stack,
-						GtkWindow *nw,
-						gboolean new_notification)
+			GtkWindow *nw,
+			gboolean new_notification)
 {
 	GtkRequisition req;
 	gint x, y;
@@ -263,15 +266,15 @@ notify_stack_add_window(NotifyStack *stack,
 	if (new_notification)
 	{
 		g_signal_connect_swapped(G_OBJECT(nw), "destroy",
-								 G_CALLBACK(notify_stack_remove_window),
-								 stack);
+					 G_CALLBACK(notify_stack_remove_window),
+					 stack);
 		stack->windows = g_slist_prepend(stack->windows, nw);
 	}
 }
 
 void
 notify_stack_remove_window(NotifyStack *stack,
-						   GtkWindow *nw)
+			   GtkWindow *nw)
 {
 	GSList *remove_l = NULL;
 
diff --git a/src/daemon/stack.h b/src/daemon/stack.h
index a2767f4..c35ac45 100644
--- a/src/daemon/stack.h
+++ b/src/daemon/stack.h
@@ -1,4 +1,5 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
  * stack.h - Notification stack groups.
  *
  * Copyright (C) 2006 Christian Hammond <chipx86 chipx86 com>
@@ -38,15 +39,17 @@ typedef enum
 typedef struct _NotifyStack NotifyStack;
 
 NotifyStack *notify_stack_new(NotifyDaemon *daemon,
-							  GdkScreen *screen,
-							  guint monitor,
-							  NotifyStackLocation stack_location);
+			      GdkScreen *screen,
+			      guint monitor,
+			      NotifyStackLocation stack_location);
 void notify_stack_destroy(NotifyStack *stack);
 
 void notify_stack_set_location(NotifyStack *stack,
-							   NotifyStackLocation location);
-void notify_stack_add_window(NotifyStack *stack, GtkWindow *nw,
-							 gboolean new_notification);
-void notify_stack_remove_window(NotifyStack *stack, GtkWindow *nw);
+			       NotifyStackLocation location);
+void notify_stack_add_window(NotifyStack *stack,
+			     GtkWindow *nw,
+			     gboolean new_notification);
+void notify_stack_remove_window(NotifyStack *stack,
+				GtkWindow *nw);
 
 #endif /* _NOTIFY_STACK_H_ */



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