sp-attribute-widget.cpp revision 1f992f84548355dd0c71b57a0175461354f1ed73
/* Authors:
* Lauris Kaplinski <lauris@ximian.com>
* Abhishek Sharma
* Kris De Gussem <Kris.DeGussem@gmail.com>
*
* Copyright (C) 2001 Ximian, Inc.
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "macros.h"
#include "document.h"
#include "sp-object.h"
#include "sp-attribute-widget.h"
using Inkscape::DocumentUndo;
// static void sp_attribute_widget_object_release ( SPObject *object,
// SPAttributeWidget *spaw );
blocked(0),
hasobj(0),
_attribute(),
modified_connection()//,
// release_connection()
{
}
{
if (hasobj)
{
{
// release_connection.disconnect();
}
}
else
{
{
}
}
}
{
if (hasobj) {
// release_connection.disconnect();
}
} else {
}
}
hasobj = true;
if (object) {
blocked = true;
modified_connection = object->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_attribute_widget_object_modified), this));
// release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&sp_attribute_widget_object_release), this));
blocked = false;
}
}
{
if (hasobj) {
// release_connection.disconnect();
}
} else {
}
}
hasobj = false;
if (repr) {
blocked = true;
blocked = false;
}
}
void SPAttributeWidget::on_changed (void)
{
if (!blocked)
{
blocked = true;
if (!*text)
_("Set attribute"));
/* TODO: Warning! Undo will not be flushed in given case */
}
blocked = false;
}
}
{
if (flags && SP_OBJECT_MODIFIED_FLAG) {
/* We are different */
spaw->set_blocked(true);
spaw->set_blocked(false);
} // end of if()
} // end of if()
} //end of if()
} // end of sp_attribute_widget_object_modified()
//static void sp_attribute_widget_object_release ( SPObject */*object*/,
// SPAttributeWidget * spaw )
//{
// spaw->set_object (NULL, NULL);
//}
/* SPAttributeTable */
static void sp_attribute_table_object_modified (SPObject *object, guint flags, SPAttributeTable *spaw);
#define XPAD 4
#define YPAD 0
blocked(0),
hasobj(0),
table(0),
_attributes(),
_entries(),
{
g_message("SPAttributeTable");
}
SPAttributeTable::SPAttributeTable (SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, Gtk::Container *parent) :
blocked(0),
hasobj(0),
table(0),
_attributes(),
_entries(),
{
g_message("SPAttributeTable");
}
{
g_message("~SPAttributeTable");
clear();
}
void SPAttributeTable::clear(void)
{
g_message("clear");
g_message("destroy 1");
if (table)
{
g_message("destroy 2a");
{
g_message("destroy 2c");
w = ch[i];
g_message("destroy 2d");
if (w != NULL)
{
try
{
delete w;
}
catch(...)
{
g_message("destroy 2d catched");
}
g_message("destroy 2e");
}
}
g_message("destroy 3");
_attributes.clear();
delete table;
}
if (hasobj) {
}
} else {
}
}
g_message("destroy 4");
}
{
g_message("set_object");
// g_return_if_fail (parent);
clear();
hasobj = true;
g_message("1");
if (object) {
g_message("2");
blocked = true;
/* Set up object */
modified_connection = object->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_attribute_table_object_modified), this));
/* Create table */
g_message("3a");
g_message("3b");
g_message("3c");
/* Fill rows */
g_message("4a");
this );
g_message("4b");
}
/* Show table */
blocked = false;
}
g_message("5");
}
{
g_message("set_repr");
clear();
hasobj = false;
if (repr) {
blocked = true;
// Set up repr
// Create table
// Fill rows
//ee->on_change = sp_attribute_table_entry_changed;
this );
}
/* Show table */
blocked = false;
}
}
{
g_message("sp_attribute_table_object_modified");
if (flags && SP_OBJECT_MODIFIED_FLAG)
{
gint i;
for (i = 0; i < (attributes.size()); i++) {
/* We are different */
}
}
}
} // end of if()
} // end of sp_attribute_table_object_modified()
//static void sp_attribute_table_object_release (SPObject */*object*/, SPAttributeTable *spat)
/*{
g_message("sp_attribute_table_object_release");
std::vector<Glib::ustring> labels;
std::vector<Glib::ustring> attributes;
spat->set_object (NULL, labels, attributes, NULL);
}*/
{
g_message("sp_attribute_table_entry_changed");
{
gint i;
for (i = 0; i < (attributes.size()); i++) {
_("Set attribute"));
/* TODO: Warning! Undo will not be flushed in given case */
}
return;
}
}
g_warning ("file %s: line %d: Entry signalled change, but there is no such entry", __FILE__, __LINE__);
} // end of if()
} // end of sp_attribute_table_entry_changed()
/*
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 :