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