dock-item.cpp revision dc33780dcf8376114aef79eeaa5259e8fe07ae84
/**
* \brief A custom Inkscape wrapper around gdl_dock_item
*
* Author:
* Gustav Broberg <broberg@kth.se>
*
* Copyright (C) 2007 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#include "dock-item.h"
#include "desktop.h"
#include "inkscape.h"
#include "preferences.h"
#include <gtkmm/invisible.h>
namespace Inkscape {
namespace UI {
namespace Widget {
_prev_position(0),
_window(0),
_x(0),
_y(0),
_grab_focus_on_realize(false),
_gdl_dock_item(0),
{
if (icon) {
// check icon type (inkscape, gtk, none)
Gtk::ICON_SIZE_MENU );
} else {
// TODO re-work this properly. Anti-crasher "null" icon for the moment
Gtk::ICON_SIZE_MENU );
}
}
delete icon;
}
} else {
}
signal_state_changed().connect(sigc::mem_fun(*this, &Inkscape::UI::Widget::DockItem::_onStateChanged));
signal_delete_event().connect(sigc::mem_fun(*this, &Inkscape::UI::Widget::DockItem::_onDeleteEvent));
show_all();
}
{
}
{
}
{
return _gdl_dock_item;
}
{
return &_dock_item_box;
}
void
DockItem::get_position(int& x, int& y)
{
if (getWindow()) {
getWindow()->get_position(x, y);
} else {
x = _x;
y = _y;
}
}
void
{
if (_window) {
} else {
}
}
void
{
if (_window)
}
void
{
if (_window)
}
void
{
if (_window)
}
void
{
}
void
{
}
void
{
NULL);
}
bool
DockItem::isAttached() const
{
return GDL_DOCK_OBJECT_ATTACHED (_gdl_dock_item);
}
bool
DockItem::isFloating() const
{
_dock.getGdlWidget());
}
bool
DockItem::isIconified() const
{
return GDL_DOCK_ITEM_ICONIFIED (_gdl_dock_item);
}
{
}
DockItem::getPrevState() const
{
return _prev_state;
}
DockItem::getPlacement() const
{
gdl_dock_object_child_placement(gdl_dock_object_get_parent_object (GDL_DOCK_OBJECT(_gdl_dock_item)),
&placement);
}
void
{
}
void
{
}
void
{
}
void
{
if (isIconified() || !isAttached()) {
show();
}
// tabbed
else if (getPlacement() == CENTER) {
if (i >= 0)
}
// always grab focus, even if we're already present
grab_focus();
_dock.scrollToItem(*this);
}
void
{
if (GTK_WIDGET_REALIZED (_gdl_dock_item)) {
// make sure the window we're in is present
}
} else {
_grab_focus_on_realize = true;
}
}
/* Signal wrappers */
{
}
{
}
{
}
{
}
Glib::SignalProxy1<void, bool>
{
}
{
}
{
return _signal_state_changed;
}
void
{
if (_window)
}
void
{
}
void
{
}
void
{
_prev_state = getState();
if (_prev_state == FLOATING_STATE)
}
void
DockItem::_onDragEnd(bool)
{
if (state != _prev_state)
if (state == FLOATING_STATE) {
if (_prev_state == FLOATING_STATE)
}
_prev_state = state;
}
void
{
if (_grab_focus_on_realize) {
_grab_focus_on_realize = false;
grab_focus();
}
}
bool
{
return return_value;
}
void
{
_window->signal_hide().connect(sigc::mem_fun(*this, &Inkscape::UI::Widget::DockItem::_onHideWindow));
_window->signal_key_press_event().connect(sigc::mem_fun(*this, &Inkscape::UI::Widget::DockItem::_onKeyPress));
}
}
bool
{
hide();
return false;
}
{
}
const Glib::SignalProxyInfo
{
"show",
};
const Glib::SignalProxyInfo
{
"hide",
};
const Glib::SignalProxyInfo
{
"delete_event",
};
const Glib::SignalProxyInfo
{
"dock-drag-begin",
};
const Glib::SignalProxyInfo
{
"dock_drag_end",
};
const Glib::SignalProxyInfo
{
"realize",
};
{
using namespace Gtk;
try {
} catch(...) {
}
}
return RType();
}
void
{
using namespace Gtk;
try {
} catch(...) {
}
}
}
} // namespace Widget
} // namespace UI
} // namespace Inkscape
/*
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:encoding=utf-8:textwidth=99 :