dc27c5a247ec3d7e9e9c17a044af5655c8f1172d
1 #ifndef __SP_ATTRIBUTE_WIDGET_H__
2 #define __SP_ATTRIBUTE_WIDGET_H__
4 /**
5 * \brief SPAttributeWidget
6 *
7 * Widget, that listens and modifies repr attributes
8 *
9 * Authors:
10 * Lauris Kaplinski <lauris@kaplinski.com>
11 *
12 * Copyright (C) 2002 authors
13 * Copyright (C) 2001 Ximian, Inc.
14 *
15 * Licensed under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include <glib.h>
20 #include <sigc++/connection.h>
22 #define SP_TYPE_ATTRIBUTE_WIDGET (sp_attribute_widget_get_type ())
23 #define SP_ATTRIBUTE_WIDGET(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_ATTRIBUTE_WIDGET, SPAttributeWidget))
24 #define SP_ATTRIBUTE_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_ATTRIBUTE_WIDGET, SPAttributeWidgetClass))
25 #define SP_IS_ATTRIBUTE_WIDGET(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_ATTRIBUTE_WIDGET))
26 #define SP_IS_ATTRIBUTE_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_ATTRIBUTE_WIDGET))
28 #define SP_TYPE_ATTRIBUTE_TABLE (sp_attribute_table_get_type ())
29 #define SP_ATTRIBUTE_TABLE(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_ATTRIBUTE_TABLE, SPAttributeTable))
30 #define SP_ATTRIBUTE_TABLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_ATTRIBUTE_TABLE, SPAttributeTableClass))
31 #define SP_IS_ATTRIBUTE_TABLE(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_ATTRIBUTE_TABLE))
32 #define SP_IS_ATTRIBUTE_TABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_ATTRIBUTE_TABLE))
34 namespace Inkscape {
35 namespace XML {
36 class Node;
37 }
38 }
41 struct SPAttributeWidget;
42 struct SPAttributeWidgetClass;
44 struct SPAttributeTable;
45 struct SPAttributeTableClass;
47 #include <gtk/gtkentry.h>
48 #include <gtk/gtkvbox.h>
50 #include <forward.h>
52 struct SPAttributeWidget {
53 GtkEntry entry;
54 guint blocked : 1;
55 guint hasobj : 1;
56 union {
57 SPObject *object;
58 Inkscape::XML::Node *repr;
59 } src;
60 gchar *attribute;
62 sigc::connection modified_connection;
63 sigc::connection release_connection;
64 };
66 struct SPAttributeWidgetClass {
67 GtkEntryClass entry_class;
68 };
70 GtkType sp_attribute_widget_get_type (void);
72 GtkWidget *sp_attribute_widget_new (SPObject *object, const gchar *attribute);
73 GtkWidget *sp_attribute_widget_new_repr (Inkscape::XML::Node *repr, const gchar *attribute);
75 void sp_attribute_widget_set_object ( SPAttributeWidget *spw,
76 SPObject *object,
77 const gchar *attribute );
78 void sp_attribute_widget_set_repr ( SPAttributeWidget *spw,
79 Inkscape::XML::Node *repr,
80 const gchar *attribute );
82 /* SPAttributeTable */
84 struct SPAttributeTable {
85 GtkVBox vbox;
86 guint blocked : 1;
87 guint hasobj : 1;
88 GtkWidget *table;
89 union {
90 SPObject *object;
91 Inkscape::XML::Node *repr;
92 } src;
93 gint num_attr;
94 gchar **attributes;
95 GtkWidget **entries;
97 sigc::connection modified_connection;
98 sigc::connection release_connection;
99 };
101 struct SPAttributeTableClass {
102 GtkEntryClass entry_class;
103 };
105 GtkType sp_attribute_table_get_type (void);
107 GtkWidget *sp_attribute_table_new ( SPObject *object, gint num_attr,
108 const gchar **labels,
109 const gchar **attributes );
110 GtkWidget *sp_attribute_table_new_repr ( Inkscape::XML::Node *repr, gint num_attr,
111 const gchar **labels,
112 const gchar **attributes );
113 void sp_attribute_table_set_object ( SPAttributeTable *spw,
114 SPObject *object, gint num_attr,
115 const gchar **labels,
116 const gchar **attrs );
117 void sp_attribute_table_set_repr ( SPAttributeTable *spw,
118 Inkscape::XML::Node *repr, gint num_attr,
119 const gchar **labels,
120 const gchar **attrs );
123 #endif
125 /*
126 Local Variables:
127 mode:c++
128 c-file-style:"stroustrup"
129 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
130 indent-tabs-mode:nil
131 fill-column:99
132 End:
133 */
134 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :