sp-attribute-widget.cpp revision 4dcab394298f613293fccedf184e1834c2274dfa
/* Authors:
* Lauris Kaplinski <lauris@ximian.com>
* Abhishek Sharma
* Kris De Gussem <Kris.DeGussem@gmail.com>
*
* Copyright (C) 2001 Ximian, Inc.
* Copyright (C) 2011, authors
* 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));
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);
#define XPAD 4
#define YPAD 0
blocked(0),
hasobj(0),
table(0),
_attributes(),
_entries(),
{
}
SPAttributeTable::SPAttributeTable (SPObject *object, std::vector<Glib::ustring> &labels, std::vector<Glib::ustring> &attributes, GtkWidget* parent) :
blocked(0),
hasobj(0),
table(0),
_attributes(),
_entries(),
{
}
{
clear();
}
void SPAttributeTable::clear(void)
{
if (table)
{
{
w = ch[i];
if (w != NULL)
{
try
{
delete w;
}
catch(...)
{
}
}
}
_attributes.clear();
delete table;
}
if (hasobj) {
}
} else {
}
}
}
{
clear();
hasobj = true;
if (object) {
blocked = true;
// Set up object
modified_connection = object->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_attribute_table_object_modified), this));
// Create table
// Fill rows
this );
}
/* Show table */
blocked = false;
}
}
{
clear();
hasobj = false;
if (repr) {
blocked = true;
// Set up repr
// Create table
// Fill rows
this );
}
/* Show table */
blocked = false;
}
}
{
if (flags && SP_OBJECT_MODIFIED_FLAG)
{
guint i;
for (i = 0; i < (attributes.size()); i++) {
/* We are different */
}
}
}
} // end of if()
} // end of sp_attribute_table_object_modified()
{
{
guint 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 :