sp-attribute-widget.cpp revision 9b81fa83753043baf5209bd3fa1a631192cabd67
/* 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;
blocked(0),
hasobj(0),
_attribute(),
{
}
{
if (hasobj)
{
{
}
}
else
{
{
}
}
}
{
if (hasobj) {
}
} 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) {
}
} 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()
{
}
/* SPAttributeTable */
static void sp_attribute_table_object_modified (SPObject *object, guint flags, SPAttributeTable *spaw);
//static void sp_attribute_table_object_release (SPObject *object, SPAttributeTable *spaw);
#define XPAD 4
#define YPAD 0
blocked(0),
hasobj(0),
table(0),
_attributes(),
_entries(),
modified_connection()/*,
release_connection()*/
{
g_message("SPAttributeTable");
}
SPAttributeTable::SPAttributeTable (SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkContainer* parent) :
blocked(0),
hasobj(0),
table(0),
_attributes(),
_entries(),
modified_connection()/*,
release_connection()*/
{
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) {
//release_connection.disconnect();
}
} else {
}
}
g_message("destroy 4");
}
{
g_message("set_object");
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));
//release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&sp_attribute_table_object_release), 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;
}
//set_sensitive ((src.object != NULL) );
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;
}
//set_sensitive ((src.repr != NULL));
}
{
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 :