dock-behavior.cpp revision 3784fb08ea9073d4a32d18d67a9eb68d66c5a073
/**
* \brief 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 "interface.h"
#include "verbs.h"
#include "dialog.h"
#include "prefs-utils.h"
#include "dialogs/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));
_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();
}
DockBehavior::gobj()
{
return _dock_item.gobj();
}
{
return _dock_item.get_vbox();
}
void
{
if (!was_attached)
}
void
DockBehavior::hide()
{
_dock_item.hide();
}
void
DockBehavior::show()
{
_dock_item.show();
}
void
{
get_vbox()->show_all_children();
}
void
DockBehavior::get_position(int &x, int &y)
{
_dock_item.get_position(x, y);
}
void
{
}
void
{
}
void
DockBehavior::move(int x, int y)
{
_dock_item.move(x, y);
}
void
{
}
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
{
// TODO probably need to avoid window calls unless the state is different. Check.
}
}
void
{
hide();
}
void
{
present();
}
void
{
}
void
{
gint transient_policy = prefs_get_int_attribute_limited ( "options.transientpolicy", "value", 1, 0, 2);
#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:encoding=utf-8:textwidth=99 :