layer-selector.cpp revision f52d835222b903a314446516c6ba5ed093dd8d9b
/*
* Inkscape::Widgets::LayerSelector - layer selector widget
*
* Authors:
* MenTaLguY <mental@rydia.net>
* Abhishek Sharma
*
* Copyright (C) 2004 MenTaLguY
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <cstring>
#include <string>
#include "ui/dialog/layer-properties.h"
#include "desktop.h"
#include "document.h"
#include "document-undo.h"
#include "layer-manager.h"
#include "sp-item.h"
#include "ui/icon-names.h"
#include "ui/widget/layer-selector.h"
#include "util/filter-list.h"
#include "util/reverse-list.h"
#include "verbs.h"
#include "xml/node-event-vector.h"
#include "widgets/gradient-vector.h"
namespace Inkscape {
namespace Widgets {
namespace {
public:
{
if (a) {
_a->set_no_show_all(true);
}
if (b) {
_b->set_no_show_all(true);
}
setState(false);
}
if (_state) {
if (_a) {
}
if (_b) {
}
} else {
if (_a) {
}
if (_b) {
}
}
}
private:
bool _state;
};
}
/** LayerSelector constructor. Creates lock and hide buttons,
* initalizes the layer dropdown selector with a label renderer,
* and hooks up signal for setting the desktop layer when the
* selector is changed.
*/
{
)
);
)
);
)
);
)
);
);
);
}
/** Destructor - disconnects signal handler
*/
LayerSelector::~LayerSelector() {
}
/** Sets the desktop for the widget. First disconnects signals
* for the current desktop, then stores the pointer to the
* given \a desktop, and attaches its signals to this one.
* Then it selects the current layer for the desktop.
*/
return;
}
if (_desktop) {
// _desktop_shutdown_connection.disconnect();
// g_signal_handlers_disconnect_by_func(_desktop, (gpointer)&detach, this);
}
if (_desktop) {
// TODO we need a different signal for this, really..s
// _desktop_shutdown_connection = _desktop->connectShutdown(
// sigc::bind (sigc::ptr_fun (detach), this));
// g_signal_connect_after(_desktop, "shutdown", GCallback(detach), this);
if ( mgr ) {
_current_layer_changed_connection = mgr->connectCurrentLayerChanged( sigc::mem_fun(*this, &LayerSelector::_selectLayer) );
//_layerUpdatedConnection = mgr->connectLayerDetailsChanged( sigc::mem_fun(*this, &LayerSelector::_updateLayer) );
_layers_changed_connection = mgr->connectChanged( sigc::mem_fun(*this, &LayerSelector::_layersChanged) );
}
}
}
namespace {
class is_layer {
public:
}
private:
};
class column_matches_object {
public:
}
private:
};
}
void LayerSelector::_layersChanged()
{
if (_desktop) {
/*
* This code fixes #166691 but causes issues #1066543 and #1080378.
* Comment out until solution found.
*/
//_selectLayer(_desktop->currentLayer());
}
}
/** Selects the given layer in the dropdown selector.
*/
}
if (_layer) {
}
if (layer) {
} else if (hierarchy) {
}
)
);
}
}
_visibility_toggle.set_sensitive(false);
_visibility_toggle.set_active(false);
_lock_toggle.set_sensitive(false);
_lock_toggle.set_active(false);
} else {
_visibility_toggle.set_sensitive(true);
_lock_toggle.set_sensitive(true);
}
}
/** Sets the current desktop layer to the actively selected layer.
*/
void LayerSelector::_setDesktopLayer() {
}
}
}
/** Creates rows in the _layer_model data structure for each item
* in \a hierarchy, to a given \a depth.
*/
{
if (remainder) {
} else {
}
}
/** Creates entries in the _layer_model data structure for
* all siblings of the first child in \a parent.
*/
) {
)
)
);
while (siblings) {
}
++siblings;
}
}
namespace {
struct Callbacks {
};
bool /*is_interactive*/, void *data)
{
} else {
}
}
void node_added(Inkscape::XML::Node */*parent*/, Inkscape::XML::Node *child, Inkscape::XML::Node */*ref*/, void *data) {
}
}
void node_removed(Inkscape::XML::Node */*parent*/, Inkscape::XML::Node *child, Inkscape::XML::Node */*ref*/, void *data) {
}
}
void *data)
{
}
}
{
)
);
}
}
{
}
}
_lock_toggled_connection.block(true);
slot();
if ( layer ) {
}
}
}
}
/** Builds and appends a row in the layer model object.
*/
)
);
)
);
NULL,
};
} else {
NULL,
NULL,
NULL,
};
}
}
/** Removes a row from the _model_columns object, disconnecting listeners
* on the slot.
*/
if (object) {
}
if (repr) {
}
delete callbacks;
}
/** Formats the label for a given layer row
*/
) {
bool label_defaulted(false);
// TODO: when the currently selected row is removed,
// (or before one has been selected) something appears to
// "invent" an iterator with null data and try to render it;
// where does it come from, and how can we avoid it?
bool isancestor = !( (layer && (object->parent == layer->parent)) || ((layer == root) && (object->parent == root)));
"<span size=\"smaller\" %s><tt>%*s%s</tt>%s%s%s%%s%s%s%s</span>",
);
label_defaulted = true;
}
} else {
label = _("(root)");
}
} else {
}
Pango::STYLE_NORMAL );
}
}
}
}
}
}
}
/*
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 :