panel.cpp revision 26c69a6606992e9945766e6efca44ddaee5e3321
/**
* \brief Panel widget
*
* Authors:
* Bryce Harrington <bryce@bryceharrington.org>
* Jon A. Cruz <jon@joncruz.org>
* Gustav Broberg <broberg@kth.se>
*
* Copyright (C) 2004 Bryce Harrington
* Copyright (C) 2005 Jon A. Cruz
* Copyright (C) 2007 Gustav Broberg
*
* Released under GNU GPL. Read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtkiconfactory.h>
#include "panel.h"
#include "icon-size.h"
#include "prefs-utils.h"
#include "desktop-handles.h"
#include "inkscape.h"
#include "dialogs/eek-preview.h"
namespace Inkscape {
namespace UI {
namespace Widget {
static const int PANEL_SETTING_SIZE = 0;
static const int PANEL_SETTING_MODE = 1;
static const int PANEL_SETTING_SHAPE = 2;
static const int PANEL_SETTING_WRAP = 3;
static const int PANEL_SETTING_NEXTFREE = 4;
GtkIconSize sizes[] = {
GTK_ICON_SIZE_DND, // Not used by options, but included to make the last size larger
};
}
/**
* Construct a Panel
*/
bool menu_desired) :
_menu(0),
_action_area(0),
_fillable(0)
{
_init();
}
{
delete _menu;
}
{
if (_menu) {
}
}
}
{
guint panel_size = 0;
if (_prefs_path) {
panel_size = prefs_get_int_attribute_limited( _prefs_path, "panel_size", 1, 0, static_cast<long long>(PREVIEW_SIZE_HUGE) );
}
guint panel_mode = 0;
if (_prefs_path) {
}
guint panel_wrap = 0;
if (_prefs_path) {
}
if (_prefs_path) {
}
{
if (panel_mode == 0) {
one->set_active(true);
} else if (panel_mode == 1) {
two->set_active(true);
}
one->signal_activate().connect(sigc::bind<int, int>(sigc::mem_fun(*this, &Panel::_bounceCall), PANEL_SETTING_MODE, 0));
two->signal_activate().connect(sigc::bind<int, int>(sigc::mem_fun(*this, &Panel::_bounceCall), PANEL_SETTING_MODE, 1));
}
{
//TRANSLATORS: Indicates size of colour swatches
const gchar *heightLabels[] = {
N_("tiny"),
N_("small"),
//TRANSLATORS: Translate only the word "medium". Indicates size of colour swatches
N_("swatchesHeight|medium"),
N_("large"),
N_("huge")
};
for (unsigned int i = 0; i < G_N_ELEMENTS(heightLabels); i++) {
if (i == panel_size) {
_item->set_active(true);
}
_item->signal_activate().connect(sigc::bind<int, int>(sigc::mem_fun(*this, &Panel::_bounceCall), PANEL_SETTING_SIZE, i));
}
}
{
//TRANSLATORS: Indicates width of colour swatches
const gchar *widthLabels[] = {
N_("narrower"),
N_("narrow"),
//TRANSLATORS: Translate only the word "medium". Indicates width of colour swatches
N_("swatchesWidth|medium"),
N_("wide"),
N_("wider")
};
// Assume all values are in increasing order
if ( values[i] <= panel_ratio ) {
hot_index = i;
}
}
if ( i <= hot_index ) {
_item->set_active(true);
}
_item->signal_activate().connect(sigc::bind<int, int>(sigc::mem_fun(*this, &Panel::_bounceCall), PANEL_SETTING_SHAPE, values[i]));
}
}
{
//TRANSLATORS: Translate only the word "Wrap". Indicates how colour swatches are displayed
check->signal_toggled().connect(sigc::bind<Gtk::CheckMenuItem*>(sigc::mem_fun(*this, &Panel::_wrapToggled), check));
}
for ( std::vector<Gtk::Widget*>::iterator iter = _non_vertical.begin(); iter != _non_vertical.end(); ++iter ) {
}
// _close_button.set_label("X");
}
// _top_bar.pack_end(_close_button, false, false);
if ( _menu_desired ) {
if ( gtk_icon_size_lookup( Inkscape::getRegisteredIconSize(Inkscape::ICON_SIZE_DECORATION), &width, &height ) ) {
}
}
pack_start(_top_bar, false, false);
pack_start(*boxy, true, true);
}
{
}
{
switch (_anchor) {
case Gtk::ANCHOR_NORTH:
case Gtk::ANCHOR_SOUTH:
{
if (_menu_desired) {
for (std::vector<Gtk::Widget*>::iterator iter = _non_horizontal.begin(); iter != _non_horizontal.end(); ++iter) {
}
for (std::vector<Gtk::Widget*>::iterator iter = _non_vertical.begin(); iter != _non_vertical.end(); ++iter) {
}
}
// Ensure we are not in "list" mode
}
break;
default:
{
if ( _menu_desired ) {
for (std::vector<Gtk::Widget*>::iterator iter = _non_horizontal.begin(); iter != _non_horizontal.end(); ++iter) {
}
for (std::vector<Gtk::Widget*>::iterator iter = _non_vertical.begin(); iter != _non_vertical.end(); ++iter) {
}
}
}
}
}
}
{
}
void Panel::restorePanelPrefs()
{
guint panel_size = 0;
if (_prefs_path) {
panel_size = prefs_get_int_attribute_limited(_prefs_path, "panel_size", 1, 0, static_cast<long long>(PREVIEW_SIZE_HUGE));
}
guint panel_mode = 0;
if (_prefs_path) {
}
guint panel_wrap = 0;
if (_prefs_path) {
}
if (_prefs_path) {
}
}
{
return _signal_response;
}
{
return _signal_present;
}
void Panel::_bounceCall(int i, int j)
{
_menu->set_active(0);
switch (i) {
case PANEL_SETTING_SIZE:
if (_prefs_path) {
}
if (_fillable) {
switch (j) {
case 0:
{
}
break;
case 1:
{
}
break;
case 2:
{
}
break;
case 3:
{
}
break;
case 4:
{
}
break;
default:
;
}
}
break;
case PANEL_SETTING_MODE:
if (_prefs_path) {
}
if (_fillable) {
switch (j) {
case 0:
{
}
break;
case 1:
{
}
break;
default:
break;
}
}
break;
case PANEL_SETTING_SHAPE:
if (_prefs_path) {
}
if ( _fillable ) {
}
break;
case PANEL_SETTING_WRAP:
if (_prefs_path) {
}
if ( _fillable ) {
}
break;
default:
_handleAction(i - PANEL_SETTING_NEXTFREE, j);
}
}
{
if (toggler) {
}
}
{
return _prefs_path;
}
{
return _label;
}
{
return _verb_num;
}
{
return _apply_label;
}
{
}
{
}
{
item->signal_activate().connect(sigc::bind<int, int>(sigc::mem_fun(*this, &Panel::_bounceCall), group + PANEL_SETTING_NEXTFREE, id));
}
{
// for subclasses to override
}
void
{
g_warning("Apply button clicked for panel [Panel::_apply()]");
}
{
return button;
}
{
return button;
}
void
{
// Create a button box for the response buttons if it's the first button to be added
if (!_action_area) {
}
if (response_id != 0) {
// Re-emit clicked signals as response signals
}
}
void
{
}
}
void
{
if (_response_map[response_id])
}
{
return _signal_document_replaced;
}
{
return _signal_activate_desktop;
}
{
return _signal_deactive_desktop;
}
void
{
switch (response_id) {
case Gtk::RESPONSE_APPLY: {
_apply();
break;
}
}
}
{
return sp_desktop_selection(_desktop);
}
} // 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 :