1 #ifndef __SP_WIDGET_H__
2 #define __SP_WIDGET_H__
4 /*
5 * Abstract base class for dynamic control widgets
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 1999-2002 Lauris Kaplinski
11 * Copyright (C) 2000-2001 Ximian, Inc.
12 *
13 * Released under GNU GPL, read the file 'COPYING' for more information
14 */
16 #include <glib.h>
18 #define SP_TYPE_WIDGET (sp_widget_get_type ())
19 #define SP_WIDGET(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_WIDGET, SPWidget))
20 #define SP_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_WIDGET, SPWidgetClass))
21 #define SP_IS_WIDGET(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_WIDGET))
22 #define SP_IS_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_WIDGET))
24 #include <gtk/gtkbin.h>
26 namespace Inkscape {
27 class Application;
28 class Selection;
29 }
31 struct SPWidget {
32 GtkBin bin;
33 Inkscape::Application *inkscape;
34 };
36 struct SPWidgetClass {
37 GtkBinClass bin_class;
38 void (* construct) (SPWidget *spw);
39 /* Selection change handlers */
40 void (* modify_selection) (SPWidget *spw, Inkscape::Selection *selection, guint flags);
41 void (* change_selection) (SPWidget *spw, Inkscape::Selection *selection);
42 void (* set_selection) (SPWidget *spw, Inkscape::Selection *selection);
43 };
45 GtkType sp_widget_get_type (void);
47 /* fixme: Think (Lauris) */
48 /* Generic constructor for global widget */
49 GtkWidget *sp_widget_new_global (Inkscape::Application *inkscape);
50 GtkWidget *sp_widget_construct_global (SPWidget *spw, Inkscape::Application *inkscape);
52 #endif