sp-attribute-widget.h revision 9b81fa83753043baf5209bd3fa1a631192cabd67
/**
* @file
* Widget that listens and modifies repr attributes.
*/
/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Kris De Gussem <Kris.DeGussem@gmail.com>
*
* Copyright (C) 2002 authors
* Copyright (C) 2001 Ximian, Inc.
*
* Licensed under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_DIALOGS_SP_ATTRIBUTE_WIDGET_H
#define SEEN_DIALOGS_SP_ATTRIBUTE_WIDGET_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>
#include <vector.h>
namespace Inkscape {
namespace XML {
class Node;
}
}
struct SPAttributeTable;
struct SPAttributeTableClass;
class SPObject;
class SPAttributeWidget : public Gtk::Entry {
//NOTE: SPAttributeWidget does not seem to be used nowhere in Inkscape, conversion to c++ not tested
public:
SPAttributeWidget ();
~SPAttributeWidget ();
void set_object(SPObject *object, const gchar *attribute);
void set_repr(Inkscape::XML::Node *repr, const gchar *attribute);
Glib::ustring get_attribute(void) {return _attribute;};
void set_blocked(guint b) {blocked = b;};
union {
SPObject *object;
Inkscape::XML::Node *repr;
} src;
protected:
void on_changed (void);
private:
guint blocked;
guint hasobj;
Glib::ustring _attribute;
sigc::connection modified_connection;
sigc::connection release_connection;
};
/* SPAttributeTable */
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;
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;
void clear(void);
};
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :