/**
* @file
* A dockable dialog implementation.
*/
/* Author:
* Gustav Broberg <broberg@kth.se>
*
* Copyright (C) 2007 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "dock-behavior.h"
#include "inkscape.h"
#include "desktop.h"
#include "ui/interface.h"
#include "verbs.h"
#include "dialog.h"
#include "preferences.h"
#include "ui/dialog-events.h"
#include <gtkmm/invisible.h>
namespace Inkscape {
namespace UI {
namespace Dialog {
namespace Behavior {
{
// Connect signals
_signal_hide_connection = signal_hide().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::Behavior::DockBehavior::_onHide));
signal_show().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::Behavior::DockBehavior::_onShow));
_dock_item.signal_state_changed().connect(sigc::mem_fun(*this, &Inkscape::UI::Dialog::Behavior::DockBehavior::_onStateChanged));
}
}
{
}
Behavior *
{
return new DockBehavior(dialog);
}
{
return _dock_item.getWidget();
}
{
return _dock_item.gobj();
}
{
return _dock_item.get_vbox();
}
void
{
if (!was_attached)
}
void
{
_dock_item.hide();
}
void
{
_dock_item.show();
}
void
{
get_vbox()->show_all_children();
}
void
{
_dock_item.get_position(x, y);
}
void
{
}
void
{
}
void
{
_dock_item.move(x, y);
}
void
{
}
void
{
}
void
{
}
void
{
}
{
// TODO check this. Seems to be bad that we ignore the parameter
get_vbox()->set_sensitive();
}
void
{
_dialog._user_hidden = true;
}
void
{
_dialog._user_hidden = false;
}
void
{
// TODO probably need to avoid window calls unless the state is different. Check.
}
}
void
{
hide();
}
void
{
present();
}
void
{
int status = (_dock_item.getState() == Inkscape::UI::Widget::DockItem::UNATTACHED) ? _dock_item.getPrevState() : _dock_item.getState();
}
void
{
#ifdef WIN32 // Win32 special code to enable transient dialogs
transient_policy = 2;
#endif
if (!transient_policy)
return;
if (floating_win) {
if (_dialog.retransientize_suppress) {
/* if retransientizing of this dialog is still forbidden after
* previous call warning turned off because it was confusingly fired
* when loading many files from command line
*/
// g_warning("Retranzientize aborted! You're switching windows too fast!");
return;
}
/*
* This enables "aggressive" transientization,
* i.e. dialogs always emerging on top when you switch documents. Note
* however that this breaks "click to raise" policy of a window
* manager because the switched-to document will be raised at once
* (so that its transients also could raise)
*/
// without this, a transient window not always emerges on top
}
}
// we're done, allow next retransientizing not sooner than after 120 msec
}
}
/* Signal wrappers */
Glib::SignalProxy1<void, bool>
} // namespace Behavior
} // namespace Dialog
} // 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:fileencoding=utf-8:textwidth=99 :