Update copyright message
[nautilus-actions.git] / src / nact / nact-iactions-list-priv.c
blobd1bad931ba2d0a4b1725ffb9d620351ee5150b59
1 /*
2 * Nautilus Actions
3 * A Nautilus extension which offers configurable context menu actions.
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009, 2010, 2011 Pierre Wieser and others (see AUTHORS)
9 * This Program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This Program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this Library; see the file COPYING. If not,
21 * write to the Free Software Foundation, Inc., 59 Temple Place,
22 * Suite 330, Boston, MA 02111-1307, USA.
24 * Authors:
25 * Frederic Ruaudel <grumz@grumz.net>
26 * Rodrigo Moya <rodrigo@gnome-db.org>
27 * Pierre Wieser <pwieser@trychlos.org>
28 * ... and many others (see AUTHORS)
31 #ifdef HAVE_CONFIG_H
32 #include <config.h>
33 #endif
35 #include "base-window.h"
36 #include "nact-iactions-list-priv.h"
38 #define IACTIONS_LIST_DATA_INSTANCE "nact-iactions-list-instance-data"
40 static gchar *v_get_treeview_name( NactIActionsList *instance );
42 GtkTreeView *
43 nact_iactions_list_priv_get_actions_list_treeview( NactIActionsList *instance )
45 gchar *widget_name;
46 GtkTreeView *treeview = NULL;
48 widget_name = v_get_treeview_name( instance );
49 if( widget_name ){
50 treeview = GTK_TREE_VIEW( base_window_get_widget( BASE_WINDOW( instance ), widget_name ));
51 g_return_val_if_fail( GTK_IS_TREE_VIEW( treeview ), NULL );
52 g_free( widget_name );
55 return( treeview );
58 /**
59 * nact_iactions_list_priv_get_instance_data:
60 * @instance: this #NactIActionsList interface.
62 * Returns a pointer to the data associated to this instance of the interface.
64 IActionsListInstanceData *
65 nact_iactions_list_priv_get_instance_data( NactIActionsList *instance )
67 IActionsListInstanceData *ialid;
69 ialid = ( IActionsListInstanceData * ) g_object_get_data( G_OBJECT( instance ), IACTIONS_LIST_DATA_INSTANCE );
71 if( !ialid ){
72 ialid = g_new0( IActionsListInstanceData, 1 );
73 g_object_set_data( G_OBJECT( instance ), IACTIONS_LIST_DATA_INSTANCE, ialid );
76 return( ialid );
79 /**
80 * nact_iactions_list_priv_send_list_count_updated_signal:
81 * @instance: this instance of #NactIActionsList interface.
82 * @ialid: the internal data structure.
84 * Send a 'fill' signal with count of items.
86 void
87 nact_iactions_list_priv_send_list_count_updated_signal( NactIActionsList *instance, IActionsListInstanceData *ialid )
89 g_signal_emit_by_name( instance,
90 IACTIONS_LIST_SIGNAL_LIST_COUNT_UPDATED,
91 ialid->menus, ialid->actions, ialid->profiles );
94 static gchar *
95 v_get_treeview_name( NactIActionsList *instance )
97 gchar *name = NULL;
99 if( NACT_IACTIONS_LIST_GET_INTERFACE( instance )->get_treeview_name ){
100 name = NACT_IACTIONS_LIST_GET_INTERFACE( instance )->get_treeview_name( instance );
103 return( name );