ink-action.cpp revision a538d96e8f6f16a20dc28b0418031a632e4a7663
#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;
}