nautilus-3.6.3/libnautilus-private/nautilus-signaller.c

No issues found

  1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
  2 
  3 /*
  4  * Nautilus
  5  *
  6  * Copyright (C) 1999, 2000 Eazel, Inc.
  7  *
  8  * Nautilus is free software; you can redistribute it and/or modify
  9  * it under the terms of the GNU General Public License as published by
 10  * the Free Software Foundation; either version 2 of the License, or
 11  * (at your option) any later version.
 12  *
 13  * This program is distributed in the hope that it will be useful,
 14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16  * GNU General Public License for more details.
 17  *
 18  * You should have received a copy of the GNU General Public License
 19  * along with this program; if not, write to the Free Software
 20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 21  *
 22  * Author: John Sullivan <sullivan@eazel.com>
 23  */
 24 
 25 /* nautilus-signaller.h: Class to manage nautilus-wide signals that don't
 26  * correspond to any particular object.
 27  */
 28 
 29 #include <config.h>
 30 #include "nautilus-signaller.h"
 31 
 32 #include <eel/eel-debug.h>
 33 
 34 typedef GObject NautilusSignaller;
 35 typedef GObjectClass NautilusSignallerClass;
 36 
 37 enum {
 38 	HISTORY_LIST_CHANGED,
 39 	POPUP_MENU_CHANGED,
 40 	USER_DIRS_CHANGED,
 41 	MIME_DATA_CHANGED,
 42 	LAST_SIGNAL
 43 };
 44 
 45 static guint signals[LAST_SIGNAL];
 46 
 47 static GType nautilus_signaller_get_type (void);
 48 
 49 G_DEFINE_TYPE (NautilusSignaller, nautilus_signaller, G_TYPE_OBJECT);
 50 
 51 GObject *
 52 nautilus_signaller_get_current (void)
 53 {
 54 	static GObject *global_signaller = NULL;
 55 
 56 	if (global_signaller == NULL) {
 57 		global_signaller = g_object_new (nautilus_signaller_get_type (), NULL);
 58 	}
 59 
 60 	return global_signaller;
 61 }
 62 
 63 static void
 64 nautilus_signaller_init (NautilusSignaller *signaller)
 65 {
 66 }
 67 
 68 static void
 69 nautilus_signaller_class_init (NautilusSignallerClass *class)
 70 {
 71 	signals[HISTORY_LIST_CHANGED] =
 72 		g_signal_new ("history_list_changed",
 73 		              G_TYPE_FROM_CLASS (class),
 74 		              G_SIGNAL_RUN_LAST,
 75 		              0,
 76 		              NULL, NULL,
 77 		              g_cclosure_marshal_VOID__VOID,
 78 		              G_TYPE_NONE, 0);
 79 	signals[POPUP_MENU_CHANGED] =
 80 		g_signal_new ("popup_menu_changed",
 81 		              G_TYPE_FROM_CLASS (class),
 82 		              G_SIGNAL_RUN_LAST,
 83 		              0,
 84 		              NULL, NULL,
 85 		              g_cclosure_marshal_VOID__VOID,
 86 		              G_TYPE_NONE, 0);
 87 	signals[USER_DIRS_CHANGED] =
 88 		g_signal_new ("user_dirs_changed",
 89 		              G_TYPE_FROM_CLASS (class),
 90 		              G_SIGNAL_RUN_LAST,
 91 		              0,
 92 		              NULL, NULL,
 93 		              g_cclosure_marshal_VOID__VOID,
 94 		              G_TYPE_NONE, 0);
 95 	signals[MIME_DATA_CHANGED] =
 96 		g_signal_new ("mime_data_changed",
 97 		              G_TYPE_FROM_CLASS (class),
 98 		              G_SIGNAL_RUN_LAST,
 99 		              0,
100 		              NULL, NULL,
101 		              g_cclosure_marshal_VOID__VOID,
102 		              G_TYPE_NONE, 0);
103 }