other-licenses/atk-1.0/atk/atkutil.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/atk-1.0/atk/atkutil.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,242 @@
     1.4 +/* ATK -  Accessibility Toolkit
     1.5 + * Copyright 2001 Sun Microsystems Inc.
     1.6 + *
     1.7 + * This library is free software; you can redistribute it and/or
     1.8 + * modify it under the terms of the GNU Library General Public
     1.9 + * License as published by the Free Software Foundation; either
    1.10 + * version 2 of the License, or (at your option) any later version.
    1.11 + *
    1.12 + * This library is distributed in the hope that it will be useful,
    1.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.15 + * Library General Public License for more details.
    1.16 + *
    1.17 + * You should have received a copy of the GNU Library General Public
    1.18 + * License along with this library; if not, write to the
    1.19 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    1.20 + * Boston, MA 02111-1307, USA.
    1.21 + */
    1.22 +
    1.23 +#ifndef __ATK_UTIL_H__
    1.24 +#define __ATK_UTIL_H__
    1.25 +
    1.26 +#include <atk/atkobject.h>
    1.27 +
    1.28 +#ifdef __cplusplus
    1.29 +extern "C" {
    1.30 +#endif /* __cplusplus */
    1.31 +
    1.32 +#define ATK_TYPE_UTIL                   (atk_util_get_type ())
    1.33 +#define ATK_IS_UTIL(obj)                G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_UTIL)
    1.34 +#define ATK_UTIL(obj)                   G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_UTIL, AtkUtil)
    1.35 +#define ATK_UTIL_CLASS(klass)                   (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_UTIL, AtkUtilClass))
    1.36 +#define ATK_IS_UTIL_CLASS(klass)                (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_UTIL))
    1.37 +#define ATK_UTIL_GET_CLASS(obj)                 (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_UTIL, AtkUtilClass))
    1.38 +
    1.39 +
    1.40 +#ifndef _TYPEDEF_ATK_UTIL_
    1.41 +#define _TYPEDEF_ATK_UTIL_
    1.42 +typedef struct _AtkUtil      AtkUtil;
    1.43 +typedef struct _AtkUtilClass AtkUtilClass;
    1.44 +typedef struct _AtkKeyEventStruct AtkKeyEventStruct;
    1.45 +#endif
    1.46 +
    1.47 +/**
    1.48 + * AtkEventListener: 
    1.49 + * @obj: An #AtkObject instance for whom the callback will be called when
    1.50 + * the specified event (e.g. 'focus:') takes place.
    1.51 + *
    1.52 + * A function which is called when an object emits a matching event,
    1.53 + * as used in #atk_add_focus_tracker.
    1.54 + * Currently the only events for which object-specific handlers are
    1.55 + * supported are events of type "focus:".  Most clients of ATK will prefer to 
    1.56 + * attach signal handlers for the various ATK signals instead.
    1.57 + *
    1.58 + * @see: atk_add_focus_tracker.
    1.59 + **/
    1.60 +typedef void  (*AtkEventListener) (AtkObject* obj);
    1.61 +/**
    1.62 + * AtkEventListenerInit:
    1.63 + *
    1.64 + * An #AtkEventListenerInit function is a special function that is
    1.65 + * called in order to initialize the per-object event registration system
    1.66 + * used by #AtkEventListener, if any preparation is required.  
    1.67 + *
    1.68 + * @see: atk_focus_tracker_init.
    1.69 + **/
    1.70 +typedef void  (*AtkEventListenerInit) (void);
    1.71 +/**
    1.72 + * AtkKeySnoopFunc:
    1.73 + * @event: an AtkKeyEventStruct containing information about the key event for which
    1.74 + * notification is being given.
    1.75 + * @func_data: a block of data which will be passed to the event listener, on notification.
    1.76 + *
    1.77 + * An #AtkKeySnoopFunc is a type of callback which is called whenever a key event occurs, 
    1.78 + * if registered via atk_add_key_event_listener.  It allows for pre-emptive 
    1.79 + * interception of key events via the return code as described below.
    1.80 + *
    1.81 + * Returns: TRUE (nonzero) if the event emission should be stopped and the event 
    1.82 + * discarded without being passed to the normal GUI recipient; FALSE (zero) if the 
    1.83 + * event dispatch to the client application should proceed as normal.
    1.84 + *
    1.85 + * @see: atk_add_key_event_listener.
    1.86 + **/
    1.87 +typedef gint  (*AtkKeySnoopFunc)  (AtkKeyEventStruct *event,
    1.88 +				   gpointer func_data);
    1.89 +
    1.90 +/**
    1.91 + * AtkKeyEventStruct:
    1.92 + * @type: An AtkKeyEventType, generally one of ATK_KEY_EVENT_PRESS or ATK_KEY_EVENT_RELEASE
    1.93 + * @state: A bitmask representing the state of the modifier keys immediately after the event takes place.   
    1.94 + * The meaning of the bits is currently defined to match the bitmask used by GDK in
    1.95 + * GdkEventType.state, see 
    1.96 + * http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html#GdkEventKey
    1.97 + * @keyval: A guint representing a keysym value corresponding to those used by GDK and X11: see
    1.98 + * /usr/X11/include/keysymdef.h.
    1.99 + * @length: The length of member #string.
   1.100 + * @string: A string containing one of the following: either a string approximating the text that would 
   1.101 + * result from this keypress, if the key is a control or graphic character, or a symbolic name for this keypress.
   1.102 + * Alphanumeric and printable keys will have the symbolic key name in this string member, for instance "A". "0", 
   1.103 + * "semicolon", "aacute".  Keypad keys have the prefix "KP".
   1.104 + * @keycode: The raw hardware code that generated the key event.  This field is raraly useful.
   1.105 + * @timestamp: A timestamp in milliseconds indicating when the event occurred.  
   1.106 + * These timestamps are relative to a starting point which should be considered arbitrary, 
   1.107 + * and only used to compare the dispatch times of events to one another.
   1.108 + *
   1.109 + * Encapsulates information about a key event.
   1.110 + **/
   1.111 +struct _AtkKeyEventStruct {
   1.112 +  gint type;
   1.113 +  guint state;
   1.114 +  guint keyval;
   1.115 +  gint length;
   1.116 +  gchar *string;
   1.117 +  guint16 keycode;
   1.118 +  guint32 timestamp;	
   1.119 +};
   1.120 +
   1.121 +/**
   1.122 + *AtkKeyEventType:
   1.123 + *@ATK_KEY_EVENT_PRESS: specifies a key press event
   1.124 + *@ATK_KEY_EVENT_RELEASE: specifies a key release event
   1.125 + *@ATK_KEY_EVENT_LAST_DEFINED: Not a valid value; specifies end of enumeration
   1.126 + *
   1.127 + *Specifies the type of a keyboard evemt.
   1.128 + **/
   1.129 +typedef enum
   1.130 +{
   1.131 +  ATK_KEY_EVENT_PRESS,
   1.132 +  ATK_KEY_EVENT_RELEASE,
   1.133 +  ATK_KEY_EVENT_LAST_DEFINED
   1.134 +} AtkKeyEventType;
   1.135 +
   1.136 +struct _AtkUtil
   1.137 +{
   1.138 +  GObject parent;
   1.139 +};
   1.140 +
   1.141 +struct _AtkUtilClass
   1.142 +{
   1.143 +   GObjectClass parent;
   1.144 +   guint        (* add_global_event_listener)    (GSignalEmissionHook listener,
   1.145 +						  const gchar        *event_type);
   1.146 +   void         (* remove_global_event_listener) (guint               listener_id);
   1.147 +   guint	(* add_key_event_listener) 	 (AtkKeySnoopFunc     listener,
   1.148 +						  gpointer data);
   1.149 +   void         (* remove_key_event_listener)    (guint               listener_id);
   1.150 +   AtkObject*   (* get_root)                     (void);
   1.151 +   G_CONST_RETURN gchar* (* get_toolkit_name)    (void);
   1.152 +   G_CONST_RETURN gchar* (* get_toolkit_version) (void);
   1.153 +};
   1.154 +GType atk_util_get_type (void);
   1.155 +
   1.156 +/**
   1.157 + *AtkCoordType:
   1.158 + *@ATK_XY_SCREEN: specifies xy coordinates relative to the screen
   1.159 + *@ATK_XY_WINDOW: specifies xy coordinates relative to the widget's 
   1.160 + * top-level window
   1.161 + *
   1.162 + *Specifies how xy coordinates are to be interpreted. Used by functions such
   1.163 + *as atk_component_get_position() and atk_text_get_character_extents() 
   1.164 + **/
   1.165 +typedef enum {
   1.166 +  ATK_XY_SCREEN,
   1.167 +  ATK_XY_WINDOW
   1.168 +}AtkCoordType;
   1.169 +
   1.170 +/*
   1.171 + * Adds the specified function to the list of functions to be called
   1.172 + * when an object receives focus.
   1.173 + */
   1.174 +guint    atk_add_focus_tracker     (AtkEventListener      focus_tracker);
   1.175 +
   1.176 +/*
   1.177 + * Removes the specified focus tracker from the list of function
   1.178 + * to be called when any object receives focus
   1.179 + */
   1.180 +void     atk_remove_focus_tracker  (guint                tracker_id);
   1.181 +
   1.182 +/*
   1.183 + * atk_focus_tracker_init:
   1.184 + * @init: An #AtkEventListenerInit function to be called
   1.185 + * prior to any focus-tracking requests.
   1.186 + *
   1.187 + * Specifies the function to be called for focus tracker initialization.
   1.188 + * removal. This function should be called by an implementation of the
   1.189 + * ATK interface if any specific work needs to be done to enable
   1.190 + * focus tracking.
   1.191 + */
   1.192 +void     atk_focus_tracker_init    (AtkEventListenerInit  init);
   1.193 +
   1.194 +/*
   1.195 + * Cause the focus tracker functions which have been specified to be
   1.196 + * executed for the object.
   1.197 + */
   1.198 +void     atk_focus_tracker_notify  (AtkObject            *object);
   1.199 +
   1.200 +/*
   1.201 + * Adds the specified function to the list of functions to be called
   1.202 + * when an event of type event_type occurs.
   1.203 + */
   1.204 +guint	atk_add_global_event_listener (GSignalEmissionHook listener,
   1.205 +				       const gchar        *event_type);
   1.206 +
   1.207 +/*
   1.208 + * Removes the specified event listener
   1.209 + */
   1.210 +void	atk_remove_global_event_listener (guint listener_id);
   1.211 +
   1.212 +/*
   1.213 + * Adds the specified function to the list of functions to be called
   1.214 + * when an keyboard event occurs.
   1.215 + */
   1.216 +guint	atk_add_key_event_listener (AtkKeySnoopFunc listener, gpointer data);
   1.217 +
   1.218 +/*
   1.219 + * Removes the specified event listener
   1.220 + */
   1.221 +void	atk_remove_key_event_listener (guint listener_id);
   1.222 +
   1.223 +/*
   1.224 + * Returns the root accessible container for the current application.
   1.225 + */
   1.226 +AtkObject* atk_get_root(void);
   1.227 +
   1.228 +AtkObject* atk_get_focus_object (void);
   1.229 +
   1.230 +/*
   1.231 + * Returns name string for the GUI toolkit.
   1.232 + */
   1.233 +G_CONST_RETURN gchar *atk_get_toolkit_name (void);
   1.234 +
   1.235 +/*
   1.236 + * Returns version string for the GUI toolkit.
   1.237 + */
   1.238 +G_CONST_RETURN gchar *atk_get_toolkit_version (void);
   1.239 +
   1.240 +#ifdef __cplusplus
   1.241 +}
   1.242 +#endif /* __cplusplus */
   1.243 +
   1.244 +
   1.245 +#endif /* __ATK_UTIL_H__ */

mercurial