ege-adjustment-action.cpp revision d7cf7f35f02a955ddad44ca159077a206e7c5a49
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is EGE Adjustment Action.
*
* The Initial Developer of the Original Code is
* Jon A. Cruz.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* Note: this file should be kept compliable as both .cpp and .c */
#include <string.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtktoolitem.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtklabel.h>
#include <gtk/gtktoolbar.h>
#include "ege-adjustment-action.h"
static void ege_adjustment_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec );
static void ege_adjustment_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec );
static GtkActionClass* gParentClass = 0;
struct _EgeAdjustmentActionPrivate
{
};
#define EGE_ADJUSTMENT_ACTION_GET_PRIVATE( o ) ( G_TYPE_INSTANCE_GET_PRIVATE( (o), EGE_ADJUSTMENT_ACTION_TYPE, EgeAdjustmentActionPrivate ) )
enum {
PROP_ADJUSTMENT = 1,
};
GType ege_adjustment_action_get_type( void )
{
if ( !myType ) {
sizeof( EgeAdjustmentActionClass ),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof( EgeAdjustmentAction ),
0, /* n_preallocs */
};
}
return myType;
}
{
if ( klass ) {
g_param_spec_object( "adjustment",
"Adjustment",
"The adjustment to change",
g_param_spec_pointer( "focus-widget",
"Focus Widget",
"The widget to return focus to",
g_param_spec_double( "climb-rate",
"Climb Rate",
"The acelleraton rate",
g_param_spec_uint( "digits",
"Digits",
"The number of digits to show",
0, 20, 0,
g_param_spec_string( "self-id",
"Self ID",
"Marker for self pointer",
0,
}
}
{
}
{
"name", name,
"label", label,
"tooltip", tooltip,
"stock_id", stock_id,
"adjustment", adjustment,
"climb-rate", climb_rate,
"digits", digits,
NULL );
return action;
}
static void ege_adjustment_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec )
{
switch ( propId ) {
case PROP_ADJUSTMENT:
break;
case PROP_FOCUS_WIDGET:
break;
case PROP_CLIMB_RATE:
break;
case PROP_DIGITS:
break;
case PROP_SELFID:
break;
default:
}
}
void ege_adjustment_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec )
{
switch ( propId ) {
case PROP_ADJUSTMENT:
{
NULL );
}
break;
case PROP_FOCUS_WIDGET:
{
/* TODO unhook prior */
}
break;
case PROP_CLIMB_RATE:
{
/* TODO pass on */
}
break;
case PROP_DIGITS:
{
/* TODO pass on */
}
break;
case PROP_SELFID:
{
/* TODO pass on */
}
break;
default:
}
}
{
}
{
/* TODO unhook prior */
}
{
}
{
return item;
}
{
}
}
{
if ( IS_EGE_ADJUSTMENT_ACTION(action) ) {
GtkWidget* spinbutton = gtk_spin_button_new( act->private_data->adj, act->private_data->climbRate, act->private_data->digits );
}
/* g_signal_connect( G_OBJECT(EGE_ADJUSTMENT_ACTION(action)->private_data->adj), "value-changed", G_CALLBACK(flippy), action ); */
} else {
}
return item;
}
{
}
{
}
{
}
}
}
{
(void)event;
if ( IS_EGE_ADJUSTMENT_ACTION(data) ) {
}
return FALSE; /* report event not consumed */
}
{
(void)widget;
(void)event;
if ( IS_EGE_ADJUSTMENT_ACTION(data) ) {
}
return FALSE; /* report event not consumed */
}
{
if ( kids ) {
}
if ( curr ) {
while ( mid ) {
/* potential target */
if ( subChildren ) {
if ( last && GTK_IS_SPIN_BUTTON(last->data) && GTK_WIDGET_IS_SENSITIVE( GTK_WIDGET(last->data) ) ) {
mid = 0; /* to stop loop */
}
}
}
}
}
}
g_list_free( kids );
}
}
return handled;
}
{
0, &key, 0, 0, 0 );
switch ( key ) {
case GDK_Escape:
{
wasConsumed = TRUE;
}
break;
case GDK_Return:
case GDK_KP_Enter:
{
wasConsumed = TRUE;
}
break;
case GDK_Tab:
{
}
break;
case GDK_ISO_Left_Tab:
{
}
break;
case GDK_Up:
case GDK_KP_Up:
{
wasConsumed = TRUE;
}
break;
case GDK_Down:
case GDK_KP_Down:
{
wasConsumed = TRUE;
}
break;
case GDK_Page_Up:
case GDK_KP_Page_Up:
{
wasConsumed = TRUE;
}
break;
case GDK_Page_Down:
case GDK_KP_Page_Down:
{
wasConsumed = TRUE;
}
break;
case GDK_z:
case GDK_Z:
{
wasConsumed = TRUE;
}
break;
}
return wasConsumed;
}