ink-action.cpp revision 6429a77c439fe0e394b18d1211ab3a692c3dea5d
#include <gtk/gtktooltips.h>
#include <gtk/gtktoolitem.h>
#include <gtk/gtktoggletoolbutton.h>
#include <gtk/gtkcheckmenuitem.h>
#include "icon-size.h"
#include "ink-action.h"
static void ink_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec );
static void ink_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec );
static GtkActionClass* gInkActionParentClass = 0;
GType ink_action_get_type( void )
{
if ( !myType ) {
sizeof( InkActionClass ),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof( InkAction ),
0, /* n_preallocs */
};
}
return myType;
}
enum {
PROP_INK_ID = 1,
};
{
if ( klass ) {
/*klass->parent_class.connect_proxy = connect_proxy;*/
/*klass->parent_class.disconnect_proxy = disconnect_proxy;*/
g_param_spec_string( "iconId",
"Icon ID",
"The id for the icon",
"",
g_param_spec_int( "iconSize",
"Icon Size",
"The size the icon",
(int)Inkscape::ICON_SIZE_MENU,
(int)Inkscape::ICON_SIZE_DECORATION,
(int)Inkscape::ICON_SIZE_SMALL_TOOLBAR,
}
}
{
}
{
"name", name,
"label", label,
"tooltip", tooltip,
"iconId", inkId,
"iconSize", size,
NULL );
return action;
}
static void ink_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec )
{
(void)action;
switch ( propId ) {
case PROP_INK_ID:
{
//g_value_set_pointer( value, action->private_data->adj );
}
break;
case PROP_INK_SIZE:
{
//g_value_set_pointer( value, action->private_data->adj );
}
break;
default:
}
}
{
(void)action;
switch ( propId ) {
case PROP_INK_ID:
{
// gchar* tmp = action->private_data->iconId;
// action->private_data->iconId = g_value_dup_string( value );
// g_free( tmp );
}
break;
case PROP_INK_SIZE:
{
// action->private_data->iconSize = g_value_get_( value );
}
break;
default:
}
}
{
g_message("INK ACTION CREATE MENU ITEM");
return item;
}
{
g_message("INK ACTION CREATE TOOL ITEM");
//item = gInkActionParentClass->create_tool_item( action );
NULL,
"use_pressure",
_("Use the pressure of the input device to alter the width of the pen"),
tt);
//g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (sp_ddc_pressure_state_changed), NULL);
//gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), prefs_get_int_attribute ("tools.calligraphic", "usepressure", 1));
return item;
}
/* --------------------------------------------------------------- */
/* --------------------------------------------------------------- */
/* --------------------------------------------------------------- */
/* --------------------------------------------------------------- */
static void ink_toggle_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec );
static void ink_toggle_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec );
static GtkToggleActionClass* gInkToggleActionParentClass = 0;
struct _InkToggleActionPrivate
{
};
#define INK_TOGGLE_ACTION_GET_PRIVATE( o ) ( G_TYPE_INSTANCE_GET_PRIVATE( (o), INK_TOGGLE_ACTION_TYPE, InkToggleActionPrivate ) )
GType ink_toggle_action_get_type( void )
{
if ( !myType ) {
sizeof( InkToggleActionClass ),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof( InkToggleAction ),
0, /* n_preallocs */
};
myType = g_type_register_static( GTK_TYPE_TOGGLE_ACTION, "InkToggleAction", &myInfo, (GTypeFlags)0 );
}
return myType;
}
{
if ( klass ) {
/*klass->parent_class.connect_proxy = connect_proxy;*/
/*klass->parent_class.disconnect_proxy = disconnect_proxy;*/
g_param_spec_string( "iconId",
"Icon ID",
"The id for the icon",
"",
g_param_spec_int( "iconSize",
"Icon Size",
"The size the icon",
(int)Inkscape::ICON_SIZE_MENU,
(int)Inkscape::ICON_SIZE_DECORATION,
(int)Inkscape::ICON_SIZE_SMALL_TOOLBAR,
}
}
{
}
{
}
{
"name", name,
"label", label,
"tooltip", tooltip,
"iconId", inkId,
"iconSize", size,
NULL );
return action;
}
static void ink_toggle_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec )
{
(void)action;
switch ( propId ) {
case PROP_INK_ID:
{
}
break;
case PROP_INK_SIZE:
{
}
break;
default:
}
}
void ink_toggle_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec )
{
(void)action;
switch ( propId ) {
case PROP_INK_ID:
{
}
break;
case PROP_INK_SIZE:
{
}
break;
default:
{
}
}
}
{
return item;
}
{
if ( GTK_IS_TOOL_BUTTON(item) ) {
} else {
// For now trigger a warning but don't do anything else
(void)button;
}
}
// TODO investigate if needed
return item;
}
/* --------------------------------------------------------------- */
/* --------------------------------------------------------------- */
/* --------------------------------------------------------------- */
/* --------------------------------------------------------------- */
static void ink_radio_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec );
static void ink_radio_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec );
static GtkRadioActionClass* gInkRadioActionParentClass = 0;
struct _InkRadioActionPrivate
{
};
#define INK_RADIO_ACTION_GET_PRIVATE( o ) ( G_TYPE_INSTANCE_GET_PRIVATE( (o), INK_RADIO_ACTION_TYPE, InkRadioActionPrivate ) )
GType ink_radio_action_get_type( void )
{
if ( !myType ) {
sizeof( InkRadioActionClass ),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof( InkRadioAction ),
0, /* n_preallocs */
};
}
return myType;
}
{
if ( klass ) {
/*klass->parent_class.connect_proxy = connect_proxy;*/
/*klass->parent_class.disconnect_proxy = disconnect_proxy;*/
g_param_spec_string( "iconId",
"Icon ID",
"The id for the icon",
"",
g_param_spec_int( "iconSize",
"Icon Size",
"The size the icon",
(int)Inkscape::ICON_SIZE_MENU,
(int)Inkscape::ICON_SIZE_DECORATION,
(int)Inkscape::ICON_SIZE_SMALL_TOOLBAR,
}
}
{
}
{
}
{
"name", name,
"label", label,
"tooltip", tooltip,
"iconId", inkId,
"iconSize", size,
NULL );
return action;
}
static void ink_radio_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec )
{
(void)action;
switch ( propId ) {
case PROP_INK_ID:
{
}
break;
case PROP_INK_SIZE:
{
}
break;
default:
}
}
void ink_radio_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec )
{
(void)action;
switch ( propId ) {
case PROP_INK_ID:
{
}
break;
case PROP_INK_SIZE:
{
}
break;
default:
{
}
}
}
{
return item;
}
{
if ( GTK_IS_TOOL_BUTTON(item) ) {
} else {
// For now trigger a warning but don't do anything else
(void)button;
}
}
// TODO investigate if needed
return item;
}