/**
* Generic button widget
*
* Authors:
* MenTaLguY <mental@rydia.net>
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 2002 Lauris Kaplinski
*
* This code is in public domain
*/
#include <glibmm.h>
#include "icon.h"
#include "button.h"
#include "helper/action-context.h"
#include "ui/interface.h"
#include "shortcuts.h"
#include <gdk/gdkkeysyms.h>
#if GTK_CHECK_VERSION(3, 0, 0)
static void sp_button_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width);
static void sp_button_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height);
#else
#endif
{
#if GTK_CHECK_VERSION(3, 0, 0)
#else
#endif
}
{
}
{
}
if (button->doubleclick_action) {
}
}
#if GTK_CHECK_VERSION(3, 0, 0)
static void sp_button_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width)
{
if (child) {
} else {
*minimal_width = 0;
*natural_width = 0;
}
}
static void sp_button_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height)
{
if (child) {
} else {
*minimal_height = 0;
*natural_height = 0;
}
}
#else
{
if (child) {
} else {
requisition->width = 0;
requisition->height = 0;
}
}
#endif
{
}
}
{
case GDK_2BUTTON_PRESS:
if (button->doubleclick_action) {
}
return TRUE;
break;
default:
break;
}
return FALSE;
}
{
}
}
GtkWidget *sp_button_new(Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action)
{
if (doubleclick_action)
// The Inkscape style is no-relief buttons
return GTK_WIDGET(button);
}
{
g_signal_handlers_block_by_func(G_OBJECT(button), (gpointer)G_CALLBACK(sp_button_perform_action), NULL);
g_signal_handlers_unblock_by_func(G_OBJECT(button), (gpointer)G_CALLBACK(sp_button_perform_action), NULL);
}
{
if (button->doubleclick_action) {
}
if (action) {
}
}
{
if (child) {
}
}
if (action) {
}
}
}
{
return;
}
/* temporarily lobotomized until SPActions are per-view */
}
}
{
if (action) {
if (shortcut != GDK_KEY_VoidSymbol) {
// there's both action and shortcut
} else {
// action has no shortcut
}
} else {
// no action
}
}
GtkWidget *sp_button_new_from_data(Inkscape::IconSize size, SPButtonType type, Inkscape::UI::View::View *view,
{
return button;
}
/*
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 :