object-attributes.cpp revision 9ba77856a8823f85b53c0a861d220cd0347f2754
/** @file
* Generic object attribute editor
*/
/*
* Inkscape, an Open Source vector graphics editor
* Copyright (C) 2012 Kris De Gussem <Kris.DeGussem@gmail.com>
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "ui/dialog/dialog-manager.h"
#include "desktop.h"
#include "macros.h"
#include "sp-anchor.h"
#include "sp-image.h"
#include "verbs.h"
#include "ui/dialog/object-attributes.h"
#include "widgets/sp-attribute-widget.h"
#include "inkscape.h"
#include "selection.h"
namespace Inkscape {
namespace UI {
namespace Dialog {
struct SPAttrDesc {
};
static const SPAttrDesc anchor_desc[] = {
// TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkRoleAttribute
// Identifies the type of the related resource with an absolute URI
// TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkArcRoleAttribute
// For situations where the nature/role alone isn't enough, this offers an additional URI defining the purpose of the link.
// TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkTitleAttribute
// TRANSLATORS: for info, see http://www.w3.org/TR/2000/CR-SVG-20000802/linking.html#AElementXLinkActuateAttribute
};
static const SPAttrDesc image_desc[] = {
};
static const SPAttrDesc image_nohref_desc[] = {
};
ObjectAttributes::ObjectAttributes (void) :
blocked (false),
deskTrack(),
{
widget_setup();
desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &ObjectAttributes::setTargetDesktop) );
}
ObjectAttributes::~ObjectAttributes (void)
{
}
void ObjectAttributes::widget_setup (void)
{
if (blocked)
{
return;
}
if (!item)
{
set_sensitive (false);
CurrentItem = NULL;
//no selection anymore or multiple objects selected, means that we need
//to close the connections to the previously selected object
return;
}
blocked = true;
// CPPIFY
// GObjectClass *klass = G_OBJECT_GET_CLASS(obj); //to deduce the object's type
// GType type = G_TYPE_FROM_CLASS(klass);
const SPAttrDesc *desc;
// if (type == SP_TYPE_ANCHOR)
if (SP_IS_ANCHOR(item))
{
desc = anchor_desc;
}
// else if (type == SP_TYPE_IMAGE)
else if (SP_IS_IMAGE(item))
{
{
}
else
{
desc = image_desc;
}
}
else
{
blocked = false;
set_sensitive (false);
return;
}
if (CurrentItem != item)
{
int len = 0;
{
len += 1;
}
CurrentItem = item;
}
else
{
}
set_sensitive (true);
show_all();
blocked = false;
}
{
if (this->desktop) {
}
selectChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(*this, &ObjectAttributes::widget_setup)));
subselChangedConn = desktop->connectToolSubselectionChanged(sigc::hide(sigc::mem_fun(*this, &ObjectAttributes::widget_setup)));
// Must check flags, so can't call widget_setup() directly.
selectModifiedConn = desktop->selection->connectModified(sigc::hide<0>(sigc::mem_fun(*this, &ObjectAttributes::selectionModifiedCB)));
}
widget_setup();
}
}
{
if (flags & ( SP_OBJECT_MODIFIED_FLAG |
}
}
}
}
}
/*
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 :