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>
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;
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;
93 };
95 struct SPAttributeTableClass {
96 GtkEntryClass entry_class;
97 };
99 GtkType sp_attribute_table_get_type (void);
101 GtkWidget *sp_attribute_table_new ( SPObject *object, gint num_attr,
102 const gchar **labels,
103 const gchar **attributes );
104 GtkWidget *sp_attribute_table_new_repr ( Inkscape::XML::Node *repr, gint num_attr,
105 const gchar **labels,
106 const gchar **attributes );
107 void sp_attribute_table_set_object ( SPAttributeTable *spw,
108 SPObject *object, gint num_attr,
109 const gchar **labels,
110 const gchar **attrs );
111 void sp_attribute_table_set_repr ( SPAttributeTable *spw,
112 Inkscape::XML::Node *repr, gint num_attr,
113 const gchar **labels,
114 const gchar **attrs );
117 #endif
119 /*
120 Local Variables:
121 mode:c++
122 c-file-style:"stroustrup"
123 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
124 indent-tabs-mode:nil
125 fill-column:99
126 End:
127 */
128 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :