summaryrefslogtreecommitdiffstats
path: root/src/widgets/sp-attribute-widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/sp-attribute-widget.h')
-rw-r--r--src/widgets/sp-attribute-widget.h70
1 files changed, 28 insertions, 42 deletions
diff --git a/src/widgets/sp-attribute-widget.h b/src/widgets/sp-attribute-widget.h
index b3437eea7..aac567987 100644
--- a/src/widgets/sp-attribute-widget.h
+++ b/src/widgets/sp-attribute-widget.h
@@ -4,6 +4,7 @@
*/
/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
+ * Kris De Gussem <Kris.DeGussem@gmail.com>
*
* Copyright (C) 2002 authors
* Copyright (C) 2001 Ximian, Inc.
@@ -14,16 +15,14 @@
#ifndef SEEN_DIALOGS_SP_ATTRIBUTE_WIDGET_H
#define SEEN_DIALOGS_SP_ATTRIBUTE_WIDGET_H
-#include <gtkmm/entry.h>
+#include <gtk/gtk.h>
+#include <gtkmm.h>
+//#include <gtkmm/entry.h>
+//#include <gtkmm/table.h>
#include <glib.h>
#include <stddef.h>
#include <sigc++/connection.h>
-
-#define SP_TYPE_ATTRIBUTE_TABLE (sp_attribute_table_get_type ())
-#define SP_ATTRIBUTE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_ATTRIBUTE_TABLE, SPAttributeTable))
-#define SP_ATTRIBUTE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_ATTRIBUTE_TABLE, SPAttributeTableClass))
-#define SP_IS_ATTRIBUTE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_ATTRIBUTE_TABLE))
-#define SP_IS_ATTRIBUTE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_ATTRIBUTE_TABLE))
+#include <vector.h>
namespace Inkscape {
namespace XML {
@@ -33,12 +32,9 @@ class Node;
struct SPAttributeTable;
struct SPAttributeTableClass;
+class SPObject;
-class SPObject;
-
-#include <gtk/gtk.h>
-
-class SPAttributeWidget : Gtk::Entry {
+class SPAttributeWidget : public Gtk::Entry {
//NOTE: SPAttributeWidget does not seem to be used nowhere in Inkscape, conversion to c++ not tested
public:
SPAttributeWidget ();
@@ -67,44 +63,34 @@ private:
/* SPAttributeTable */
-struct SPAttributeTable {
- GtkVBox vbox;
- guint blocked : 1;
- guint hasobj : 1;
- GtkWidget *table;
+class SPAttributeTable : public Gtk::Widget {
+public:
+ SPAttributeTable ();
+ SPAttributeTable (SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkContainer* parent);
+ ~SPAttributeTable ();
+ void set_object(SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkContainer* parent);
+ void set_repr(Inkscape::XML::Node *repr, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkContainer* parent);
+ std::vector<Glib::ustring> get_attributes(void) {return _attributes;};
+ std::vector<Gtk::Widget *> get_entries(void) {return _entries;};
union {
SPObject *object;
Inkscape::XML::Node *repr;
} src;
- gint num_attr;
- gchar **attributes;
- GtkWidget **entries;
+ guint blocked;
+ guint hasobj;
+private:
+// GtkVBox vbox;
+ Gtk::Table *table;
+// Gtk::Container *_parent;
+ std::vector<Glib::ustring> _attributes;
+ std::vector<Gtk::Widget *> _entries;
sigc::connection modified_connection;
- sigc::connection release_connection;
-};
-
-struct SPAttributeTableClass {
- GtkEntryClass entry_class;
+ //sigc::connection release_connection;
+
+ void clear(void);
};
-GType sp_attribute_table_get_type (void);
-
-GtkWidget *sp_attribute_table_new ( SPObject *object, gint num_attr,
- const gchar **labels,
- const gchar **attributes );
-GtkWidget *sp_attribute_table_new_repr ( Inkscape::XML::Node *repr, gint num_attr,
- const gchar **labels,
- const gchar **attributes );
-void sp_attribute_table_set_object ( SPAttributeTable *spw,
- SPObject *object, gint num_attr,
- const gchar **labels,
- const gchar **attrs );
-void sp_attribute_table_set_repr ( SPAttributeTable *spw,
- Inkscape::XML::Node *repr, gint num_attr,
- const gchar **labels,
- const gchar **attrs );
-
#endif
/*