button.cpp revision 8c8ef8f6b62e09ebb1b519c22905826210346968
#define __SP_BUTTON_C__
/*
* 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
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "icon.h"
#include "shortcuts.h"
#include "interface.h"
#include <gdk/gdkkeysyms.h>
#include "button.h"
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
static GtkToggleButtonClass *parent_class;
GType sp_button_get_type(void)
{
if (!type) {
sizeof(SPButtonClass),
0, // base_init
0, // base_finalize
0, // class_finalize
0, // class_data
sizeof(SPButton),
0, // n_preallocs
0 // value_table
};
type = g_type_register_static(GTK_TYPE_TOGGLE_BUTTON, "SPButton", &info, static_cast<GTypeFlags>(0));
}
return type;
}
static void
{
#if GTK_CHECK_VERSION(3,0,0)
#else
#endif
}
static void
{
}
{
}
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
static void
{
}
}
static gint
{
case GDK_2BUTTON_PRESS:
if (button->doubleclick_action) {
}
return TRUE;
break;
default:
break;
}
return FALSE;
}
static void
{
}
}
sp_button_new( Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action )
{
if (doubleclick_action)
// The Inkscape style is no-relief buttons
}
void
{
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);
}
static void
{
if (button->doubleclick_action) {
}
if (action) {
}
}
static void
{
if (child) {
}
}
if (action) {
GTK_WIDGET(button)));
}
}
}
static void
{
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
}
}
{
return button;
}