From: billh Date: Wed, 25 Jul 2001 18:26:40 +0000 (+0000) Subject: Initial revision X-Git-Tag: AT_SPI2_ATK_2_12_0~1623 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=commitdiff_plain;h=9bf98cd378e1572019a743bb4bf18e896b4fcd1d Initial revision git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@2 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..0101d03 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,26 @@ +ABOUT-NLS +INSTALL +COPYING +Makefile +Makefile.in +aclocal.m4 +config.cache +config.guess +config.h +config.h.in +config.log +config.status +config.sub +configure +intl +install-sh +libtool +ltconfig +ltmain.sh +mkinstalldirs +missing +oaf.spec +oaf.spec.in +stamp-h +stamp-h.in +xml-i18n-* diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..3ff0f65 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,6 @@ +2001-06-29 Michael Meeks + + * configure.in: add AM_CONFIG_HEADER to gen config.h + + * acconfig.h: add. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..2e28afc --- /dev/null +++ b/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS=po intl docs idl libspi registryd test + +EXTRA_DIST= xml-i18n-extract.in xml-i18n-merge.in xml-i18n-update.in diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/acconfig.h b/acconfig.h new file mode 100644 index 0000000..c3a1a37 --- /dev/null +++ b/acconfig.h @@ -0,0 +1,6 @@ +#undef ENABLE_NLS +#undef HAVE_CATGETS +#undef HAVE_DLADDR +#undef HAVE_GETTEXT +#undef HAVE_LC_MESSAGES +#undef HAVE_STPCPY diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..72ded62 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +PKG_NAME="at-spi" + +USE_GNOME2_MACROS=1 . gnome-autogen.sh diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..2989d8b --- /dev/null +++ b/configure.in @@ -0,0 +1,100 @@ +AC_INIT(idl/Accessible.idl) + +AT_SPI_MAJOR_VERSION=0 +AT_SPI_MINOR_VERSION=0 +AT_SPI_MICRO_VERSION=1 +AT_SPI_INTERFACE_AGE=0 +AT_SPI_BINARY_AGE=0 +AT_SPI_VERSION="$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION.$AT_SPI_MICRO_VERSION" +AM_INIT_AUTOMAKE(at-spi, $AT_SPI_VERSION) +AC_SUBST(AT_SPI_MAJOR_VERSION) +AC_SUBST(AT_SPI_MINOR_VERSION) +AC_SUBST(AT_SPI_MICRO_VERSION) +AC_SUBST(AT_SPI_INTERFACE_AGE) +AC_SUBST(AT_SPI_BINARY_AGE) + +# libtool versioning +LT_RELEASE=$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION +LT_CURRENT=`expr $AT_SPI_MICRO_VERSION - $AT_SPI_INTERFACE_AGE` +LT_REVISION=$AT_SPI_INTERFACE_AGE +LT_AGE=`expr $AT_SPI_BINARY_AGE - $AT_SPI_INTERFACE_AGE` +LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}' +AC_SUBST(LT_VERSION_INFO) +AC_SUBST(LT_RELEASE) +AC_SUBST(LT_CURRENT) +AC_SUBST(LT_REVISION) +AC_SUBST(LT_AGE) + +dnl Specify a header configuration file +AM_CONFIG_HEADER(config.h) + +dnl Initialize maintainer mode +AM_MAINTAINER_MODE + +AM_PROG_XML_I18N_TOOLS + +dnl Checks for programs +AC_PROG_CC +AC_PROG_INSTALL +AC_ISC_POSIX + +GNOME_COMMON_INIT +GNOME_PLATFORM_GNOME_2(yes, force) +GNOME_COMPILE_WARNINGS(maximum) + +dnl Initialize libtool +AM_DISABLE_STATIC +AM_PROG_LIBTOOL + +dnl internationalization support +ALL_LINGUAS="" +AM_GNOME2_GETTEXT + +dnl Checks for libraries +PKG_CHECK_MODULES(LIBSPI, oaf-2.0 >= 0.7.0 libbonobo-2.0 >= 1.97.0 ORBit-2.0 >= 2.3.91 atk >= 0.2) +AC_SUBST(LIBSPI_LIBS) +AC_SUBST(LIBSPI_CFLAGS) + +PKG_CHECK_MODULES(REGISTRYD, oaf-2.0 >= 0.7.0 libbonobo-2.0 >= 1.97.0 atk >= 0.2) +AC_SUBST(REGISTRYD_LIBS) +AC_SUBST(REGISTRYD_CFLAGS) + +PKG_CHECK_MODULES(TESTS, oaf-2.0 >= 0.7.0 libbonobo-2.0 >= 1.97.0 ORBit-2.0 atk >= 0.2) +AC_SUBST(TESTS_LIBS) +AC_SUBST(TESTS_CFLAGS) + +dnl orbit-idl. +ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`" +AC_SUBST(ORBIT_IDL) + +dnl Bonobo and OAF idl files +OAF_IDL_DIR="`$PKG_CONFIG --variable=idldir oaf-2.0`" +LIBBONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`" +AC_SUBST(OAF_IDL_DIR) +AC_SUBST(LIBBONOBO_IDL_DIR) + +AC_SUBST(CFLAGS) +AC_SUBST(CPPFLAGS) +AC_SUBST(LDFLAGS) + +AC_OUTPUT([ +Makefile +po/Makefile.in +intl/Makefile +docs/Makefile +idl/Makefile +libspi/Makefile +registryd/Makefile +registryd/Accessibility_Registry.oaf +test/Makefile +]) + +echo "AT-SPI setup: + + Source code location: ${srcdir} + Compiler: ${CC} + Prefix: ${prefix} + + Welcome to the wonderful world of Accessibility. + http://developer.gnome.org/projects/gap/ +" diff --git a/docs/.cvsignore b/docs/.cvsignore new file mode 100644 index 0000000..282522d --- /dev/null +++ b/docs/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..e69de29 diff --git a/idl/.cvsignore b/idl/.cvsignore new file mode 100644 index 0000000..282522d --- /dev/null +++ b/idl/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/idl/Accessibility_Accessible.idl b/idl/Accessibility_Accessible.idl new file mode 100644 index 0000000..e004678 --- /dev/null +++ b/idl/Accessibility_Accessible.idl @@ -0,0 +1,100 @@ +#ifndef _ACCESSIBILITY_ACCESSIBLE_IDL +#define _ACCESSIBILITY_ACCESSIBLE_IDL + + +#include + +#if !defined(__ACCESSIBILITY_ACCESSIBLE_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Accessible.h +%} +#pragma inhibit push +#endif + +#include "Relation.idl" +#include "State.idl" +#include "Role.idl" + +module Accessibility { + + typedef sequence RelationSet; + + interface Accessible : Bonobo::Unknown { + + /** + * #attribute description: a (short) @string representing the object's name. + **/ + attribute string name; + + /** + * #attribute description: a @string describing the object in more detail than @name. + **/ + attribute string description; + + /** + * #attribute parent: an @Accessible object which is this object's containing object. + **/ + readonly attribute Accessible parent; + + /** + * getChildCount: + * return values: the number of children contained by this object (zero if none). + * + * Get the number of children contained by this object. + * + **/ + readonly attribute long childCount; + + /** + * getChildAtIndex: + * @index: an in parameter indicating which child is requested (zero-indexed). + * return values: the 'nth' @Accessible child of this object. + * + * Get the accessible child of this object at index @index. + * + **/ + Accessible getChildAtIndex (in long index); + + /** + * getIndexInParent: + * return values: a long integer indicating this object's index in the parent's list. + * + * Get the index of this object in its parent's child list. + * + **/ + long getIndexInParent (); + + /** + * getRelationSet: + * return values: a @RelationSet defining this object's relationships. + * + * Get a set defining this object's relationship to other accessible objects. + * + **/ + RelationSet getRelationSet (); + + /** + * getRole: + * return values: the @Role of this object. + * + * Get the @Role indicating the type of UI role played by this object. + * + **/ + Role getRole (); + + /** + * getState: + * return values: a @StateSet encapsulating the currently true states of the object. + * + * Get the current state of the object as a @StateSet. + **/ + StateSet getState (); + }; +}; + +#if !defined(__ACCESSIBILITY_ACCESSIBLE_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif + diff --git a/idl/Accessibility_Application.idl b/idl/Accessibility_Application.idl new file mode 100644 index 0000000..e79c9f8 --- /dev/null +++ b/idl/Accessibility_Application.idl @@ -0,0 +1,68 @@ +#ifndef __ACCESSIBILITY_APPLICATION_DEFINED__ +#define __ACCESSIBILITY_APPLICATION_DEFINED__ + +#include +#include + +#if !defined(__ACCESSIBILITY_APPLICATION_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Application.h +%} +#pragma inhibit push +#endif + +#pragma inhibit push +#include "Accessible.idl" +#pragma inhibit pop + +module Accessibility { + interface Application : Accessible { + + /** + * Get a string indicating the type of user interface toolkit + * which is used by the application. + * Ordinarily clients of @AccessibleApplication should be + * toolkit-agnostic, dependencies on this method probably + * should be reconsidered! + **/ + readonly attribute string toolkitName; + + /** + * Get a string indicating the version number of the application's + * accessibility bridge implementation. + **/ + readonly attribute string version; + + /** + * Get the application's process ID in the operating system's + * process table. + * + **/ + readonly attribute string id; + + /** + * pause: + * Returns: %true if the request succeeded, %false otherwise. + * + * Request that the application temporarily stop sending events. + * In most cases this should pause the application's main event loop. + * + **/ + boolean pause (); + + /** + * resume: + * Returns: %true if the request succeeded, %false otherwise. + * + * Request that the application resume sending events. + * + **/ + boolean resume (); + }; +}; + +#if !defined(__ACCESSIBILITY_APPLICATION_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Accessibility_Desktop.idl b/idl/Accessibility_Desktop.idl new file mode 100644 index 0000000..375ed18 --- /dev/null +++ b/idl/Accessibility_Desktop.idl @@ -0,0 +1,31 @@ +#ifndef __ACCESSIBILITY_DESKTOP_DEFINED__ +#define __ACCESSIBILITY_DESKTOP_DEFINED__ + +#include +#include + +#if !defined(__ACCESSIBILITY_DESKTOP_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Desktop.h +%} +#pragma inhibit push +#endif + +#pragma inhibit push +#include "Accessible.idl" +#pragma inhibit pop + +module Accessibility { + interface Desktop : Accessible { + /** + * At the moment this is only a marker interface, it acts just like + * any other Accessible. + **/ + }; +}; + +#if !defined(__ACCESSIBILITY_DESKTOP_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Accessibility_Event.idl b/idl/Accessibility_Event.idl new file mode 100644 index 0000000..4e7e956 --- /dev/null +++ b/idl/Accessibility_Event.idl @@ -0,0 +1,39 @@ +#ifndef __ACCESSIBILITY_EVENT_DEFINED__ +#define __ACCESSIBILITY_EVENT_DEFINED__ + +#include + +#if !defined(__ACCESSIBILITY_EVENT_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Accessible.h +#pragma include_defs Event.h +%} +#pragma inhibit push +#endif + +#pragma inhibit push +#include "Accessible.idl" +#pragma inhibit pop + +module Accessibility +{ + interface Accessible; + + struct Event { + string type; + Accessible target; + long detail1; + long detail2; + }; + + interface EventListener : Bonobo::Unknown { + oneway void notifyEvent (in Event e); + }; + +}; + +#if !defined(__ACCESSIBILITY_EVENT_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Accessibility_Registry.idl b/idl/Accessibility_Registry.idl new file mode 100644 index 0000000..91359f2 --- /dev/null +++ b/idl/Accessibility_Registry.idl @@ -0,0 +1,178 @@ +#include +#include +#include +#include + +module Accessibility { + + typedef sequence DesktopSeq; + + interface DeviceEventController; + + interface Registry : EventListener { + + /** + * registerApplication: + * @application: a reference to the requesting @Application + * return values: void + * + * Register a new application with the accessibility broker. + * + **/ + void registerApplication (in Application application); + + /** + * deregisterApplication: + * @application: a reference to the @Application + * to be deregistered. + * return values: void + * + * De-register an application previously registered with the broker. + * + **/ + void deregisterApplication (in Application application); + + /** + * registerGlobalEventListener: + * @listener: a reference to the requesting @EventListener. + * @eventName: a string which indicates the type of events about + * which the client desires notification. + * return values: void + * + * Register a client's interest in (all) application events of + * a certain type. + * + **/ + void registerGlobalEventListener (in EventListener listener, + in string eventName); + + /** + * deregisterGlobalEventListener: + * @listener: the requesting @EventListener + * @eventName: a string indicating the type of events + * return values: void + * + * Request that a previously registered client stop receiving + * global notifications for events of a certain type. + * + **/ + + void deregisterGlobalEventListener (in EventListener listener); + /** + * event types: "Window" "Desktop" + * "Window:Create" "Window:Destroy" + * "Window:Iconify" "Window:Restore" + * "Window:Fullscreen" "Window:Resize" + * "Desktop:Create" "Desktop:Destroy" + * "Desktop:Focus" "Desktop:Defocus" + * "Desktop:Reorder" + * "Focus" + * "GtkWidget:show" + * "GObject:notify:" + * + * ( not sure we should allow these last 2 forms, + * since they are toolkit-specific, but they're powerful ) + * + **/ + + /** + * getDesktopCount: + * return values: a short integer indicating the current number of + * @Desktops. + * + * Get the current number of desktops. + * + **/ + short getDesktopCount (); + + /** + * getDesktop: + * @n: the index of the requested @Desktop. + * return values: a reference to the requested @Desktop. + * + * Get the nth accessible desktop. + * + **/ + Desktop getDesktop (in short n); + + /** + * getDesktopList: + * return values: a sequence containing references to + * the @Desktops. + * + * Get a list of accessible desktops. + * + **/ + DesktopSeq getDesktopList (); + + /** + * getDeviceEventController: + * return values: an object implementing DeviceEventController + * + **/ + DeviceEventController getDeviceEventController (); + + }; + + enum KeyEventType { + KEY_PRESSED, + KEY_RELEASED + }; + + enum ModifierType { + MODIFIER_ALT, + MODIFIER_META, + MODIFIER_CONTROL, + MODIFIER_SHIFT, + MODIFIER_META2, + MODIFIER_META3 + }; + + typedef sequence ModifierSeq; + + struct KeyStroke { + long keyID; + KeyEventType type; + ModifierSeq modifiers; + }; + + interface KeystrokeListener { + boolean keyEvent (in KeyStroke key); + }; + + interface DeviceEventController { + + /** + * registerKeystrokeListener: + * @listener: a @KeystrokeListener which will intercept key events. + * Returns: void + * + * Register to intercept keyboard events, and either pass them on or + * consume them. + * + **/ + void registerKeystrokeListener (in KeystrokeListener listener); + + /** + * generateKeyEvent: + * @keyEventID: a long integer indicating which keypress is synthesized. + * Returns: void + * + * Synthesize a keypress event. + * + **/ + void generateKeyEvent (in long keyEventID); + + /** + * generateMouseEvent: + * @x: a long integer indicating the screen x coord for the mouse event. + * @y: a long integer indicating the screen y coord for the mouse event. + * @eventName: a string indicating the type of mouse event, e.g. "button1up" + * Returns: void + * + * Synthesize a mouse event. + * + **/ + void generateMouseEvent (in long x, in long y, in string eventName); + }; +}; diff --git a/idl/Accessibility_Relation.idl b/idl/Accessibility_Relation.idl new file mode 100644 index 0000000..c091a19 --- /dev/null +++ b/idl/Accessibility_Relation.idl @@ -0,0 +1,37 @@ +#ifndef _ACCESSIBILITY_RELATION_IDL +#define _ACCESSIBILITY_RELATION_IDL + +#if !defined(__ACCESSIBILITY_RELATION_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Relation.h +%} +#pragma inhibit push +#endif + +module Accessibility { + + enum RelationType { + RELATION_LABEL_FOR, + RELATION_LABELLED_BY, + RELATION_CONTROLLER_FOR, + RELATION_CONTROLLED_BY, + RELATION_MEMBER_OF + }; + + /* + * + * This interface inherits from a base class implementing ref counts. + * + */ + + interface Relation { + RelationType getRelationType (); + Object getTarget (); + }; +}; + +#if !defined(__ACCESSIBILITY_RELATION_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Accessibility_Role.idl b/idl/Accessibility_Role.idl new file mode 100644 index 0000000..890e826 --- /dev/null +++ b/idl/Accessibility_Role.idl @@ -0,0 +1,196 @@ +#ifndef _ACCESSIBILITY_ROLE_IDL +#define _ACCESSIBILITY_ROLE_IDL + +#if !defined(__ACCESSIBILITY_ROLE_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Role.h +%} +#pragma inhibit push +#endif + +module Accessibility { + + enum Role { + ROLE_INVALID, + /* Object is used to alert the user about something */ + ROLE_ALERT, + /* Object that can be drawn into and is used to trap events */ + ROLE_CANVAS, + /* + * A choice that can be checked or unchecked and provides a separate + * indicator for the current state. + */ + ROLE_CHECK_BOX, + /* A specialized dialog that lets the user choose a color. */ + ROLE_COLOR_CHOOSER, + /* The header for a column of data */ + ROLE_COLUMN_HEADER, + /* A list of choices the user can select from */ + ROLE_COMBO_BOX, + /* An inconifed internal frame within a DESKTOP_PANE */ + ROLE_DESKTOP_ICON, + /* + * A pane that supports internal frames and iconified versions of those + * internal frames. + */ + ROLE_DESKTOP_FRAME, + /* A top level window with title bar and a border */ + ROLE_DIALOG, + /* + * A pane that allows the user to navigate through and select the contents + * of a directory + */ + ROLE_DIRECTORY_PANE, + /* + * A specialized dialog that displays the files in the directory and lets + * the user select a file, browse a different directory, or specify a + * filename. + */ + ROLE_FILE_CHOOSER, + /* + * A object that fills up space in a user interface + */ + ROLE_FILLER, + /* XXX Don't know sure about this. */ + ROLE_FOCUS_TRAVERSABLE, + /* A top level window with a title bar, border, menubar, etc. */ + ROLE_FRAME, + /* A pane that is guaranteed to be painted on top of all panes beneath it */ + ROLE_GLASS_PANE, + /* + * A document container for HTML, whose children + * represent the document content. + */ + ROLE_HTML_CONTAINER, + /* A small fixed size picture, typically used to decorate components */ + ROLE_ICON, + /* A frame-like object that is clipped by a desktop pane. */ + ROLE_INTERNAL_FRAME, + /* An object used to present an icon or short string in an interface */ + ROLE_LABEL, + /* + * A specialized pane that allows its children to be drawn in layers, + * providing a form of stacking order. + */ + ROLE_LAYERED_PANE, + /* + * An object that presents a list of objects to the user and allows the + * user to select one or more of them. + */ + ROLE_LIST, + /* An object that represents an element of a list. */ + ROLE_LIST_ITEM, + /* + * An object usually found inside a menu bar that contains a list of + * actions the user can choose from. + */ + ROLE_MENU, + /* + * An object usually drawn at the top of the primary dialog box of an + * application that contains a list of menus the user can choose from. + */ + ROLE_MENU_BAR, + /* + * An object usually contained in a menu that presents an action the + * user can choose. + */ + ROLE_MENU_ITEM, + /* A specialized pane whose primary use is inside a DIALOG */ + ROLE_OPTION_PANE, + /* An object that is a child of a page tab list */ + ROLE_PAGE_TAB, + /* + * An object that presents a series of panels (or page tabs), one at a time, + * through some mechanism provided by the object. + */ + ROLE_PAGE_TAB_LIST, + /* A generic container that is often used to group objects. */ + ROLE_PANEL, + /* + * A text object uses for passwords, or other places where the text + * content is not shown visibly to the user. + */ + ROLE_PASSWORD_TEXT, + /* + * A temporary window that is usually used to offer the user a list of + * choices, and then hides when the user selects one of those choices. + */ + ROLE_POPUP_MENU, + /* An object used to indicate how much of a task has been completed. */ + ROLE_PROGRESS_BAR, + /* + * An object the user can manipulate to tell the application to do + * something. + */ + ROLE_PUSH_BUTTON, + /* + * A specialized check box that will cause other radio buttons in the + * same group to become uncghecked when this one is checked. + */ + ROLE_RADIO_BUTTON, + /* + * A specialized pane that has a glass pane and a layered pane as its + * children. + */ + ROLE_ROOT_PANE, + /* The header for a row of data */ + ROLE_ROW_HEADER, + /* + * An object usually used to allow a user to incrementally view a large + * amount of data. + */ + ROLE_SCROLL_BAR, + /* + * An object that allows a user to incrementally view a large amount + * of information. + */ + ROLE_SCROLL_PANE, + /* + * An object usually contained in a menu to provide a visible and + * logical separation of the contents in a menu. + */ + ROLE_SEPARATOR, + /* An object that allows the user to select from a bounded range */ + ROLE_SLIDER, + /* A specialized panel that presents two other panels at the same time. */ + ROLE_SPLIT_PANE, + /* An object used to rpesent information in terms of rows and columns. */ + ROLE_TABLE, + ROLE_TABLE_CELL, + ROLE_TABLE_COLUMN_HEADER, + ROLE_TABLE_ROW_HEADER, + /* An object that presents text to the user */ + ROLE_TEXT, + /* + * A specialized push button that can be checked or unchecked, but does + * not procide a separate indicator for the current state. + */ + ROLE_TOGGLE_BUTTON, + /* + * A bar or palette usually composed of push buttons or toggle buttons + */ + ROLE_TOOL_BAR, + /* + * An object that provides information about another object + */ + ROLE_TOOL_TIP, + /* An object used to repsent hierarchical information to the user. */ + ROLE_TREE, + /* + * The object contains some Accessible information, but its role is + * not known. + */ + ROLE_UNKNOWN, + /* An object usually used in a scroll pane. */ + ROLE_VIEWPORT, + /* A top level window with no title or border */ + ROLE_WINDOW, + /* not a valid role, used for finding end of enumeration. */ + ROLE_LAST_DEFINED + }; +}; +#if !defined(__ACCESSIBILITY_ROLE_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Accessibility_State.idl b/idl/Accessibility_State.idl new file mode 100644 index 0000000..5d0b1c9 --- /dev/null +++ b/idl/Accessibility_State.idl @@ -0,0 +1,103 @@ +#ifndef _ACCESSIBILITY_STATE_IDL +#define _ACCESSIBILITY_STATE_IDL + +#if !defined(__ACCESSIBILITY_STATE_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs State.h +%} +#pragma inhibit push +#endif + +module Accessibility { + + enum StateType { + STATE_INVALID, + /* Indicates a window is currently the active window */ + STATE_ACTIVE, + /* Indicates that the object is armed */ + STATE_ARMED, + /* Indicates the current object is busy */ + STATE_BUSY, + /* Indicates this object is currently checked */ + STATE_CHECKED, + /* Indicates this object is collapsed */ + STATE_COLLAPSED, + /* Indicates the user can change the contents of this object */ + STATE_EDITABLE, + /* Indicates this object allows progressive disclosure of its children */ + STATE_EXPANDABLE, + /* Indicates this object its expanded */ + STATE_EXPANDED, + /* + * Indicates this object can accept keyboard focus, which means all + * events resulting from typing on the keyboard will normally be passed + * to it when it has focus + */ + STATE_FOCUSABLE, + /* Indicates this object currently has the keyboard focus */ + STATE_FOCUSED, + /* Indicates the orientation of thsi object is horizontal */ + STATE_HORIZONTAL, + /* Indicates this object is minimized and is represented only by an icon */ + STATE_ICONIFIED, + /* + * Indicates something must be done with this object before the user can + * interact with an object in a different window. + */ + STATE_MODAL, + /* Indicates this (text) object can contain multiple lines of text */ + STATE_MULTI_LINE, + /* + * Indicates this object allows more than one of its children to be + * selected at the same time + */ + STATE_MULTISELECTABLE, + /* Indicates this object paints every pixel within its rectangular region. */ + STATE_OPAQUE, + /* Indicates this object is currently pressed */ + STATE_PRESSED, + /* Indicates the size of this object is not fixed */ + STATE_RESIZABLE, + /* + * Indicates this object is the child of an object that allows its + * children to be selected and that this child is one of those children + * that can be selected. + */ + STATE_SELECTABLE, + /* + * Indicates this object is the child of an object that allows its + * children to be selected and that this child is one of those children + * that has been selected. + */ + STATE_SELECTED, + /* Indicates this object is sensitive */ + STATE_SENSITIVE, + /* + * Indicates this object, the object's parent, the object's parent's + * parent, and so on, are all visible + */ + STATE_SHOWING, + /* Indicates this (text) object can contain only a single line of text */ + STATE_SINGLE_LINE, + /* Indicates this object is transient */ + STATE_TRANSIENT, + /* Indicates the orientation of this object is vertical */ + STATE_VERTICAL, + /* Indicates this object is visible */ + STATE_VISIBLE, + STATE_LAST_DEFINED + }; + + interface StateSet { + boolean contains (in StateType state); + void add (in StateType state); + void remove (in StateType state); + boolean equals (in StateSet stateSet); + void compare (in StateSet compareState, out StateSet differenceSet); + boolean isEmpty (); + }; +}; +#if !defined(__ACCESSIBILITY_STATE_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif +#endif diff --git a/idl/Accessible.idl b/idl/Accessible.idl new file mode 100644 index 0000000..e004678 --- /dev/null +++ b/idl/Accessible.idl @@ -0,0 +1,100 @@ +#ifndef _ACCESSIBILITY_ACCESSIBLE_IDL +#define _ACCESSIBILITY_ACCESSIBLE_IDL + + +#include + +#if !defined(__ACCESSIBILITY_ACCESSIBLE_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Accessible.h +%} +#pragma inhibit push +#endif + +#include "Relation.idl" +#include "State.idl" +#include "Role.idl" + +module Accessibility { + + typedef sequence RelationSet; + + interface Accessible : Bonobo::Unknown { + + /** + * #attribute description: a (short) @string representing the object's name. + **/ + attribute string name; + + /** + * #attribute description: a @string describing the object in more detail than @name. + **/ + attribute string description; + + /** + * #attribute parent: an @Accessible object which is this object's containing object. + **/ + readonly attribute Accessible parent; + + /** + * getChildCount: + * return values: the number of children contained by this object (zero if none). + * + * Get the number of children contained by this object. + * + **/ + readonly attribute long childCount; + + /** + * getChildAtIndex: + * @index: an in parameter indicating which child is requested (zero-indexed). + * return values: the 'nth' @Accessible child of this object. + * + * Get the accessible child of this object at index @index. + * + **/ + Accessible getChildAtIndex (in long index); + + /** + * getIndexInParent: + * return values: a long integer indicating this object's index in the parent's list. + * + * Get the index of this object in its parent's child list. + * + **/ + long getIndexInParent (); + + /** + * getRelationSet: + * return values: a @RelationSet defining this object's relationships. + * + * Get a set defining this object's relationship to other accessible objects. + * + **/ + RelationSet getRelationSet (); + + /** + * getRole: + * return values: the @Role of this object. + * + * Get the @Role indicating the type of UI role played by this object. + * + **/ + Role getRole (); + + /** + * getState: + * return values: a @StateSet encapsulating the currently true states of the object. + * + * Get the current state of the object as a @StateSet. + **/ + StateSet getState (); + }; +}; + +#if !defined(__ACCESSIBILITY_ACCESSIBLE_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif + diff --git a/idl/Application.idl b/idl/Application.idl new file mode 100644 index 0000000..e79c9f8 --- /dev/null +++ b/idl/Application.idl @@ -0,0 +1,68 @@ +#ifndef __ACCESSIBILITY_APPLICATION_DEFINED__ +#define __ACCESSIBILITY_APPLICATION_DEFINED__ + +#include +#include + +#if !defined(__ACCESSIBILITY_APPLICATION_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Application.h +%} +#pragma inhibit push +#endif + +#pragma inhibit push +#include "Accessible.idl" +#pragma inhibit pop + +module Accessibility { + interface Application : Accessible { + + /** + * Get a string indicating the type of user interface toolkit + * which is used by the application. + * Ordinarily clients of @AccessibleApplication should be + * toolkit-agnostic, dependencies on this method probably + * should be reconsidered! + **/ + readonly attribute string toolkitName; + + /** + * Get a string indicating the version number of the application's + * accessibility bridge implementation. + **/ + readonly attribute string version; + + /** + * Get the application's process ID in the operating system's + * process table. + * + **/ + readonly attribute string id; + + /** + * pause: + * Returns: %true if the request succeeded, %false otherwise. + * + * Request that the application temporarily stop sending events. + * In most cases this should pause the application's main event loop. + * + **/ + boolean pause (); + + /** + * resume: + * Returns: %true if the request succeeded, %false otherwise. + * + * Request that the application resume sending events. + * + **/ + boolean resume (); + }; +}; + +#if !defined(__ACCESSIBILITY_APPLICATION_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Desktop.idl b/idl/Desktop.idl new file mode 100644 index 0000000..375ed18 --- /dev/null +++ b/idl/Desktop.idl @@ -0,0 +1,31 @@ +#ifndef __ACCESSIBILITY_DESKTOP_DEFINED__ +#define __ACCESSIBILITY_DESKTOP_DEFINED__ + +#include +#include + +#if !defined(__ACCESSIBILITY_DESKTOP_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Desktop.h +%} +#pragma inhibit push +#endif + +#pragma inhibit push +#include "Accessible.idl" +#pragma inhibit pop + +module Accessibility { + interface Desktop : Accessible { + /** + * At the moment this is only a marker interface, it acts just like + * any other Accessible. + **/ + }; +}; + +#if !defined(__ACCESSIBILITY_DESKTOP_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Event.idl b/idl/Event.idl new file mode 100644 index 0000000..4e7e956 --- /dev/null +++ b/idl/Event.idl @@ -0,0 +1,39 @@ +#ifndef __ACCESSIBILITY_EVENT_DEFINED__ +#define __ACCESSIBILITY_EVENT_DEFINED__ + +#include + +#if !defined(__ACCESSIBILITY_EVENT_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Accessible.h +#pragma include_defs Event.h +%} +#pragma inhibit push +#endif + +#pragma inhibit push +#include "Accessible.idl" +#pragma inhibit pop + +module Accessibility +{ + interface Accessible; + + struct Event { + string type; + Accessible target; + long detail1; + long detail2; + }; + + interface EventListener : Bonobo::Unknown { + oneway void notifyEvent (in Event e); + }; + +}; + +#if !defined(__ACCESSIBILITY_EVENT_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Makefile.am b/idl/Makefile.am new file mode 100644 index 0000000..e4c4a8b --- /dev/null +++ b/idl/Makefile.am @@ -0,0 +1,12 @@ +idldir = $(datadir)/idl + +idl_DATA = Accessible.idl \ + Desktop.idl \ + Relation.idl \ + State.idl \ + Application.idl \ + Event.idl \ + Registry.idl \ + Role.idl + +EXTRA_DIST=$(idl_DATA) diff --git a/idl/Registry.idl b/idl/Registry.idl new file mode 100644 index 0000000..91359f2 --- /dev/null +++ b/idl/Registry.idl @@ -0,0 +1,178 @@ +#include +#include +#include +#include + +module Accessibility { + + typedef sequence DesktopSeq; + + interface DeviceEventController; + + interface Registry : EventListener { + + /** + * registerApplication: + * @application: a reference to the requesting @Application + * return values: void + * + * Register a new application with the accessibility broker. + * + **/ + void registerApplication (in Application application); + + /** + * deregisterApplication: + * @application: a reference to the @Application + * to be deregistered. + * return values: void + * + * De-register an application previously registered with the broker. + * + **/ + void deregisterApplication (in Application application); + + /** + * registerGlobalEventListener: + * @listener: a reference to the requesting @EventListener. + * @eventName: a string which indicates the type of events about + * which the client desires notification. + * return values: void + * + * Register a client's interest in (all) application events of + * a certain type. + * + **/ + void registerGlobalEventListener (in EventListener listener, + in string eventName); + + /** + * deregisterGlobalEventListener: + * @listener: the requesting @EventListener + * @eventName: a string indicating the type of events + * return values: void + * + * Request that a previously registered client stop receiving + * global notifications for events of a certain type. + * + **/ + + void deregisterGlobalEventListener (in EventListener listener); + /** + * event types: "Window" "Desktop" + * "Window:Create" "Window:Destroy" + * "Window:Iconify" "Window:Restore" + * "Window:Fullscreen" "Window:Resize" + * "Desktop:Create" "Desktop:Destroy" + * "Desktop:Focus" "Desktop:Defocus" + * "Desktop:Reorder" + * "Focus" + * "GtkWidget:show" + * "GObject:notify:" + * + * ( not sure we should allow these last 2 forms, + * since they are toolkit-specific, but they're powerful ) + * + **/ + + /** + * getDesktopCount: + * return values: a short integer indicating the current number of + * @Desktops. + * + * Get the current number of desktops. + * + **/ + short getDesktopCount (); + + /** + * getDesktop: + * @n: the index of the requested @Desktop. + * return values: a reference to the requested @Desktop. + * + * Get the nth accessible desktop. + * + **/ + Desktop getDesktop (in short n); + + /** + * getDesktopList: + * return values: a sequence containing references to + * the @Desktops. + * + * Get a list of accessible desktops. + * + **/ + DesktopSeq getDesktopList (); + + /** + * getDeviceEventController: + * return values: an object implementing DeviceEventController + * + **/ + DeviceEventController getDeviceEventController (); + + }; + + enum KeyEventType { + KEY_PRESSED, + KEY_RELEASED + }; + + enum ModifierType { + MODIFIER_ALT, + MODIFIER_META, + MODIFIER_CONTROL, + MODIFIER_SHIFT, + MODIFIER_META2, + MODIFIER_META3 + }; + + typedef sequence ModifierSeq; + + struct KeyStroke { + long keyID; + KeyEventType type; + ModifierSeq modifiers; + }; + + interface KeystrokeListener { + boolean keyEvent (in KeyStroke key); + }; + + interface DeviceEventController { + + /** + * registerKeystrokeListener: + * @listener: a @KeystrokeListener which will intercept key events. + * Returns: void + * + * Register to intercept keyboard events, and either pass them on or + * consume them. + * + **/ + void registerKeystrokeListener (in KeystrokeListener listener); + + /** + * generateKeyEvent: + * @keyEventID: a long integer indicating which keypress is synthesized. + * Returns: void + * + * Synthesize a keypress event. + * + **/ + void generateKeyEvent (in long keyEventID); + + /** + * generateMouseEvent: + * @x: a long integer indicating the screen x coord for the mouse event. + * @y: a long integer indicating the screen y coord for the mouse event. + * @eventName: a string indicating the type of mouse event, e.g. "button1up" + * Returns: void + * + * Synthesize a mouse event. + * + **/ + void generateMouseEvent (in long x, in long y, in string eventName); + }; +}; diff --git a/idl/Relation.idl b/idl/Relation.idl new file mode 100644 index 0000000..c091a19 --- /dev/null +++ b/idl/Relation.idl @@ -0,0 +1,37 @@ +#ifndef _ACCESSIBILITY_RELATION_IDL +#define _ACCESSIBILITY_RELATION_IDL + +#if !defined(__ACCESSIBILITY_RELATION_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Relation.h +%} +#pragma inhibit push +#endif + +module Accessibility { + + enum RelationType { + RELATION_LABEL_FOR, + RELATION_LABELLED_BY, + RELATION_CONTROLLER_FOR, + RELATION_CONTROLLED_BY, + RELATION_MEMBER_OF + }; + + /* + * + * This interface inherits from a base class implementing ref counts. + * + */ + + interface Relation { + RelationType getRelationType (); + Object getTarget (); + }; +}; + +#if !defined(__ACCESSIBILITY_RELATION_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/Role.idl b/idl/Role.idl new file mode 100644 index 0000000..890e826 --- /dev/null +++ b/idl/Role.idl @@ -0,0 +1,196 @@ +#ifndef _ACCESSIBILITY_ROLE_IDL +#define _ACCESSIBILITY_ROLE_IDL + +#if !defined(__ACCESSIBILITY_ROLE_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs Role.h +%} +#pragma inhibit push +#endif + +module Accessibility { + + enum Role { + ROLE_INVALID, + /* Object is used to alert the user about something */ + ROLE_ALERT, + /* Object that can be drawn into and is used to trap events */ + ROLE_CANVAS, + /* + * A choice that can be checked or unchecked and provides a separate + * indicator for the current state. + */ + ROLE_CHECK_BOX, + /* A specialized dialog that lets the user choose a color. */ + ROLE_COLOR_CHOOSER, + /* The header for a column of data */ + ROLE_COLUMN_HEADER, + /* A list of choices the user can select from */ + ROLE_COMBO_BOX, + /* An inconifed internal frame within a DESKTOP_PANE */ + ROLE_DESKTOP_ICON, + /* + * A pane that supports internal frames and iconified versions of those + * internal frames. + */ + ROLE_DESKTOP_FRAME, + /* A top level window with title bar and a border */ + ROLE_DIALOG, + /* + * A pane that allows the user to navigate through and select the contents + * of a directory + */ + ROLE_DIRECTORY_PANE, + /* + * A specialized dialog that displays the files in the directory and lets + * the user select a file, browse a different directory, or specify a + * filename. + */ + ROLE_FILE_CHOOSER, + /* + * A object that fills up space in a user interface + */ + ROLE_FILLER, + /* XXX Don't know sure about this. */ + ROLE_FOCUS_TRAVERSABLE, + /* A top level window with a title bar, border, menubar, etc. */ + ROLE_FRAME, + /* A pane that is guaranteed to be painted on top of all panes beneath it */ + ROLE_GLASS_PANE, + /* + * A document container for HTML, whose children + * represent the document content. + */ + ROLE_HTML_CONTAINER, + /* A small fixed size picture, typically used to decorate components */ + ROLE_ICON, + /* A frame-like object that is clipped by a desktop pane. */ + ROLE_INTERNAL_FRAME, + /* An object used to present an icon or short string in an interface */ + ROLE_LABEL, + /* + * A specialized pane that allows its children to be drawn in layers, + * providing a form of stacking order. + */ + ROLE_LAYERED_PANE, + /* + * An object that presents a list of objects to the user and allows the + * user to select one or more of them. + */ + ROLE_LIST, + /* An object that represents an element of a list. */ + ROLE_LIST_ITEM, + /* + * An object usually found inside a menu bar that contains a list of + * actions the user can choose from. + */ + ROLE_MENU, + /* + * An object usually drawn at the top of the primary dialog box of an + * application that contains a list of menus the user can choose from. + */ + ROLE_MENU_BAR, + /* + * An object usually contained in a menu that presents an action the + * user can choose. + */ + ROLE_MENU_ITEM, + /* A specialized pane whose primary use is inside a DIALOG */ + ROLE_OPTION_PANE, + /* An object that is a child of a page tab list */ + ROLE_PAGE_TAB, + /* + * An object that presents a series of panels (or page tabs), one at a time, + * through some mechanism provided by the object. + */ + ROLE_PAGE_TAB_LIST, + /* A generic container that is often used to group objects. */ + ROLE_PANEL, + /* + * A text object uses for passwords, or other places where the text + * content is not shown visibly to the user. + */ + ROLE_PASSWORD_TEXT, + /* + * A temporary window that is usually used to offer the user a list of + * choices, and then hides when the user selects one of those choices. + */ + ROLE_POPUP_MENU, + /* An object used to indicate how much of a task has been completed. */ + ROLE_PROGRESS_BAR, + /* + * An object the user can manipulate to tell the application to do + * something. + */ + ROLE_PUSH_BUTTON, + /* + * A specialized check box that will cause other radio buttons in the + * same group to become uncghecked when this one is checked. + */ + ROLE_RADIO_BUTTON, + /* + * A specialized pane that has a glass pane and a layered pane as its + * children. + */ + ROLE_ROOT_PANE, + /* The header for a row of data */ + ROLE_ROW_HEADER, + /* + * An object usually used to allow a user to incrementally view a large + * amount of data. + */ + ROLE_SCROLL_BAR, + /* + * An object that allows a user to incrementally view a large amount + * of information. + */ + ROLE_SCROLL_PANE, + /* + * An object usually contained in a menu to provide a visible and + * logical separation of the contents in a menu. + */ + ROLE_SEPARATOR, + /* An object that allows the user to select from a bounded range */ + ROLE_SLIDER, + /* A specialized panel that presents two other panels at the same time. */ + ROLE_SPLIT_PANE, + /* An object used to rpesent information in terms of rows and columns. */ + ROLE_TABLE, + ROLE_TABLE_CELL, + ROLE_TABLE_COLUMN_HEADER, + ROLE_TABLE_ROW_HEADER, + /* An object that presents text to the user */ + ROLE_TEXT, + /* + * A specialized push button that can be checked or unchecked, but does + * not procide a separate indicator for the current state. + */ + ROLE_TOGGLE_BUTTON, + /* + * A bar or palette usually composed of push buttons or toggle buttons + */ + ROLE_TOOL_BAR, + /* + * An object that provides information about another object + */ + ROLE_TOOL_TIP, + /* An object used to repsent hierarchical information to the user. */ + ROLE_TREE, + /* + * The object contains some Accessible information, but its role is + * not known. + */ + ROLE_UNKNOWN, + /* An object usually used in a scroll pane. */ + ROLE_VIEWPORT, + /* A top level window with no title or border */ + ROLE_WINDOW, + /* not a valid role, used for finding end of enumeration. */ + ROLE_LAST_DEFINED + }; +}; +#if !defined(__ACCESSIBILITY_ROLE_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif + +#endif diff --git a/idl/State.idl b/idl/State.idl new file mode 100644 index 0000000..5d0b1c9 --- /dev/null +++ b/idl/State.idl @@ -0,0 +1,103 @@ +#ifndef _ACCESSIBILITY_STATE_IDL +#define _ACCESSIBILITY_STATE_IDL + +#if !defined(__ACCESSIBILITY_STATE_COMPILATION) && defined(__ORBIT_IDL__) +%{ +#pragma include_defs State.h +%} +#pragma inhibit push +#endif + +module Accessibility { + + enum StateType { + STATE_INVALID, + /* Indicates a window is currently the active window */ + STATE_ACTIVE, + /* Indicates that the object is armed */ + STATE_ARMED, + /* Indicates the current object is busy */ + STATE_BUSY, + /* Indicates this object is currently checked */ + STATE_CHECKED, + /* Indicates this object is collapsed */ + STATE_COLLAPSED, + /* Indicates the user can change the contents of this object */ + STATE_EDITABLE, + /* Indicates this object allows progressive disclosure of its children */ + STATE_EXPANDABLE, + /* Indicates this object its expanded */ + STATE_EXPANDED, + /* + * Indicates this object can accept keyboard focus, which means all + * events resulting from typing on the keyboard will normally be passed + * to it when it has focus + */ + STATE_FOCUSABLE, + /* Indicates this object currently has the keyboard focus */ + STATE_FOCUSED, + /* Indicates the orientation of thsi object is horizontal */ + STATE_HORIZONTAL, + /* Indicates this object is minimized and is represented only by an icon */ + STATE_ICONIFIED, + /* + * Indicates something must be done with this object before the user can + * interact with an object in a different window. + */ + STATE_MODAL, + /* Indicates this (text) object can contain multiple lines of text */ + STATE_MULTI_LINE, + /* + * Indicates this object allows more than one of its children to be + * selected at the same time + */ + STATE_MULTISELECTABLE, + /* Indicates this object paints every pixel within its rectangular region. */ + STATE_OPAQUE, + /* Indicates this object is currently pressed */ + STATE_PRESSED, + /* Indicates the size of this object is not fixed */ + STATE_RESIZABLE, + /* + * Indicates this object is the child of an object that allows its + * children to be selected and that this child is one of those children + * that can be selected. + */ + STATE_SELECTABLE, + /* + * Indicates this object is the child of an object that allows its + * children to be selected and that this child is one of those children + * that has been selected. + */ + STATE_SELECTED, + /* Indicates this object is sensitive */ + STATE_SENSITIVE, + /* + * Indicates this object, the object's parent, the object's parent's + * parent, and so on, are all visible + */ + STATE_SHOWING, + /* Indicates this (text) object can contain only a single line of text */ + STATE_SINGLE_LINE, + /* Indicates this object is transient */ + STATE_TRANSIENT, + /* Indicates the orientation of this object is vertical */ + STATE_VERTICAL, + /* Indicates this object is visible */ + STATE_VISIBLE, + STATE_LAST_DEFINED + }; + + interface StateSet { + boolean contains (in StateType state); + void add (in StateType state); + void remove (in StateType state); + boolean equals (in StateSet stateSet); + void compare (in StateSet compareState, out StateSet differenceSet); + boolean isEmpty (); + }; +}; +#if !defined(__ACCESSIBILITY_STATE_COMPILATION) && defined(__ORBIT_IDL__) +#pragma inhibit pop +#endif +#endif diff --git a/libspi/Makefile.am b/libspi/Makefile.am new file mode 100644 index 0000000..c9f33a6 --- /dev/null +++ b/libspi/Makefile.am @@ -0,0 +1,84 @@ +lib_LTLIBRARIES = libspi.la + +INCLUDES = -I $(top_srcdir) \ + -I $(top_builddir) \ + -I $(top_srcdir)/libspi \ + -I $(top_builddir)/libspi \ + $(LIBSPI_CFLAGS) + +LDFLAGS = $(LIBSPI_LIBS) @LT_VERSION_INFO@ + +libspiincludedir = $(includedir)/libspi + +libspiinclude_HEADERS = accessible.h \ + application.h \ + atksimpleobject.h \ + desktop.h \ + listener.h \ + registry.h \ + Accessible.h \ + Application.h \ + Desktop.h \ + Event.h \ + Registry.h \ + Relation.h \ + Role.h \ + State.h + +Accessible_IDLOUT = Accessible.h Accessible-stubs.c Accessible-skels.c Accessible-common.c +Application_IDLOUT = Application.h Application-stubs.c Application-skels.c Application-common.c +Desktop_IDLOUT = Desktop.h Desktop-stubs.c Desktop-skels.c Desktop-common.c +Event_IDLOUT = Event.h Event-stubs.c Event-skels.c Event-common.c +Registry_IDLOUT = Registry.h Registry-stubs.c Registry-skels.c Registry-common.c +Relation_IDLOUT = Relation.h Relation-stubs.c Relation-skels.c Relation-common.c +Role_IDLOUT = Role.h Role-stubs.c Role-skels.c Role-common.c +State_IDLOUT = State.h State-stubs.c State-skels.c State-common.c + +BUILT_SOURCES = $(Accessible_IDLOUT) \ + $(Application_IDLOUT) \ + $(Desktop_IDLOUT) \ + $(Event_IDLOUT) \ + $(Registry_IDLOUT) \ + $(Relation_IDLOUT) \ + $(Role_IDLOUT) \ + $(State_IDLOUT) + +libspi_la_SOURCES = accessible.c \ + accessible.h \ + application.c \ + application.h \ + atksimpleobject.c \ + atksimpleobject.h \ + desktop.c \ + desktop.h \ + listener.c \ + listener.h \ + registry.c \ + registry.h \ + $(BUILT_SOURCES) + +IDLFLAGS = -I$(OAF_IDL_DIR) -I$(LIBBONOBO_IDL_DIR) -I$(top_srcdir)/idl --noimodule + +$(Accessible_IDLOUT): $(top_srcdir)/idl/Accessible.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_ACCESSIBLE_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Accessible.idl + +$(Application_IDLOUT): $(top_srcdir)/idl/Application.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_APPLICATION_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Application.idl + +$(Desktop_IDLOUT): $(top_srcdir)/idl/Desktop.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_DESKTOP_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Desktop.idl + +$(Event_IDLOUT): $(top_srcdir)/idl/Event.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_EVENT_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Event.idl + +$(Registry_IDLOUT): $(top_srcdir)/idl/Registry.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_REGISTRY_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Registry.idl + +$(Relation_IDLOUT): $(top_srcdir)/idl/Relation.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_RELATION_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Relation.idl + +$(Role_IDLOUT): $(top_srcdir)/idl/Role.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_ROLE_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Role.idl + +$(State_IDLOUT): $(top_srcdir)/idl/State.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_STATE_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/State.idl diff --git a/libspi/Makefile.in b/libspi/Makefile.in new file mode 100644 index 0000000..2f5639c --- /dev/null +++ b/libspi/Makefile.in @@ -0,0 +1,484 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +AT_SPI_BINARY_AGE = @AT_SPI_BINARY_AGE@ +AT_SPI_INTERFACE_AGE = @AT_SPI_INTERFACE_AGE@ +AT_SPI_MAJOR_VERSION = @AT_SPI_MAJOR_VERSION@ +AT_SPI_MICRO_VERSION = @AT_SPI_MICRO_VERSION@ +AT_SPI_MINOR_VERSION = @AT_SPI_MINOR_VERSION@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +DATADIRNAME = @DATADIRNAME@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNOME_ACLOCAL_DIR = @GNOME_ACLOCAL_DIR@ +GNOME_ACLOCAL_FLAGS = @GNOME_ACLOCAL_FLAGS@ +GNOME_INTERFACE_VERSION = @GNOME_INTERFACE_VERSION@ +GTKDOC = @GTKDOC@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +HAVE_GTK_DOC = @HAVE_GTK_DOC@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +LIBBONOBO_IDL_DIR = @LIBBONOBO_IDL_DIR@ +LIBSPI_CFLAGS = @LIBSPI_CFLAGS@ +LIBSPI_LIBS = @LIBSPI_LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +OAF_IDL_DIR = @OAF_IDL_DIR@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +ORBIT_IDL = @ORBIT_IDL@ +PACKAGE = @PACKAGE@ +PKG_CONFIG = @PKG_CONFIG@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +REGISTRYD_CFLAGS = @REGISTRYD_CFLAGS@ +REGISTRYD_LIBS = @REGISTRYD_LIBS@ +STRIP = @STRIP@ +TESTS_CFLAGS = @TESTS_CFLAGS@ +TESTS_LIBS = @TESTS_LIBS@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XML_I18N_EXTRACT = @XML_I18N_EXTRACT@ +XML_I18N_MERGE = @XML_I18N_MERGE@ +XML_I18N_TOOLS_PERL = @XML_I18N_TOOLS_PERL@ +XML_I18N_UPDATE = @XML_I18N_UPDATE@ +cxxflags_set = @cxxflags_set@ +l = @l@ + +lib_LTLIBRARIES = libspi.la + +INCLUDES = -I $(top_srcdir) -I $(top_builddir) -I $(top_srcdir)/libspi -I $(top_builddir)/libspi $(LIBSPI_CFLAGS) + + +LDFLAGS = $(LIBSPI_LIBS) @LT_VERSION_INFO@ + +libspiincludedir = $(includedir)/libspi + +libspiinclude_HEADERS = accessible.h application.h atksimpleobject.h desktop.h listener.h registry.h Accessible.h Application.h Desktop.h Event.h Registry.h Relation.h Role.h State.h + + +Accessible_IDLOUT = Accessible.h Accessible-stubs.c Accessible-skels.c Accessible-common.c +Application_IDLOUT = Application.h Application-stubs.c Application-skels.c Application-common.c +Desktop_IDLOUT = Desktop.h Desktop-stubs.c Desktop-skels.c Desktop-common.c +Event_IDLOUT = Event.h Event-stubs.c Event-skels.c Event-common.c +Registry_IDLOUT = Registry.h Registry-stubs.c Registry-skels.c Registry-common.c +Relation_IDLOUT = Relation.h Relation-stubs.c Relation-skels.c Relation-common.c +Role_IDLOUT = Role.h Role-stubs.c Role-skels.c Role-common.c +State_IDLOUT = State.h State-stubs.c State-skels.c State-common.c + +BUILT_SOURCES = $(Accessible_IDLOUT) $(Application_IDLOUT) $(Desktop_IDLOUT) $(Event_IDLOUT) $(Registry_IDLOUT) $(Relation_IDLOUT) $(Role_IDLOUT) $(State_IDLOUT) + + +libspi_la_SOURCES = accessible.c accessible.h application.c application.h atksimpleobject.c atksimpleobject.h desktop.c desktop.h listener.c listener.h registry.c registry.h $(BUILT_SOURCES) + + +IDLFLAGS = -I$(OAF_IDL_DIR) -I$(LIBBONOBO_IDL_DIR) -I$(top_srcdir)/idl --noimodule +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +LIBS = @LIBS@ +libspi_la_LDFLAGS = +libspi_la_LIBADD = +libspi_la_OBJECTS = accessible.lo application.lo atksimpleobject.lo \ +desktop.lo listener.lo registry.lo Accessible-stubs.lo \ +Accessible-skels.lo Accessible-common.lo Application-stubs.lo \ +Application-skels.lo Application-common.lo Desktop-stubs.lo \ +Desktop-skels.lo Desktop-common.lo Event-stubs.lo Event-skels.lo \ +Event-common.lo Registry-stubs.lo Registry-skels.lo Registry-common.lo \ +Relation-stubs.lo Relation-skels.lo Relation-common.lo Role-stubs.lo \ +Role-skels.lo Role-common.lo State-stubs.lo State-skels.lo \ +State-common.lo +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +HEADERS = $(libspiinclude_HEADERS) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +DEP_FILES = .deps/Accessible-common.P .deps/Accessible-skels.P \ +.deps/Accessible-stubs.P .deps/Application-common.P \ +.deps/Application-skels.P .deps/Application-stubs.P \ +.deps/Desktop-common.P .deps/Desktop-skels.P .deps/Desktop-stubs.P \ +.deps/Event-common.P .deps/Event-skels.P .deps/Event-stubs.P \ +.deps/Registry-common.P .deps/Registry-skels.P .deps/Registry-stubs.P \ +.deps/Relation-common.P .deps/Relation-skels.P .deps/Relation-stubs.P \ +.deps/Role-common.P .deps/Role-skels.P .deps/Role-stubs.P \ +.deps/State-common.P .deps/State-skels.P .deps/State-stubs.P \ +.deps/accessible.P .deps/application.P .deps/atksimpleobject.P \ +.deps/desktop.P .deps/listener.P .deps/registry.P +SOURCES = $(libspi_la_SOURCES) +OBJECTS = $(libspi_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu libspi/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-libLTLIBRARIES: + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + +distclean-libLTLIBRARIES: + +maintainer-clean-libLTLIBRARIES: + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libspi.la: $(libspi_la_OBJECTS) $(libspi_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libspi_la_LDFLAGS) $(libspi_la_OBJECTS) $(libspi_la_LIBADD) $(LIBS) + +install-libspiincludeHEADERS: $(libspiinclude_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libspiincludedir) + @list='$(libspiinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libspiincludedir)/$$p"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libspiincludedir)/$$p; \ + done + +uninstall-libspiincludeHEADERS: + @$(NORMAL_UNINSTALL) + list='$(libspiinclude_HEADERS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(libspiincludedir)/$$p; \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = libspi + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu libspi/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-libLTLIBRARIES +install-exec: install-exec-am + +install-data-am: install-libspiincludeHEADERS +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-libLTLIBRARIES uninstall-libspiincludeHEADERS +uninstall: uninstall-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(libspiincludedir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags mostlyclean-depend \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ + clean-depend clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-libLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-depend \ + distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-depend \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ +clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ +uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile \ +mostlyclean-libtool distclean-libtool clean-libtool \ +maintainer-clean-libtool uninstall-libspiincludeHEADERS \ +install-libspiincludeHEADERS tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir mostlyclean-depend \ +distclean-depend clean-depend maintainer-clean-depend info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +$(Accessible_IDLOUT): $(top_srcdir)/idl/Accessible.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_ACCESSIBLE_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Accessible.idl + +$(Application_IDLOUT): $(top_srcdir)/idl/Application.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_APPLICATION_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Application.idl + +$(Desktop_IDLOUT): $(top_srcdir)/idl/Desktop.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_DESKTOP_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Desktop.idl + +$(Event_IDLOUT): $(top_srcdir)/idl/Event.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_EVENT_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Event.idl + +$(Registry_IDLOUT): $(top_srcdir)/idl/Registry.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_REGISTRY_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Registry.idl + +$(Relation_IDLOUT): $(top_srcdir)/idl/Relation.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_RELATION_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Relation.idl + +$(Role_IDLOUT): $(top_srcdir)/idl/Role.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_ROLE_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/Role.idl + +$(State_IDLOUT): $(top_srcdir)/idl/State.idl $(ORBIT_IDL) + $(ORBIT_IDL) -D__ACCESSIBILITY_STATE_COMPILATION $(IDLFLAGS) $(top_srcdir)/idl/State.idl + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libspi/accessible.c b/libspi/accessible.c new file mode 100644 index 0000000..96b0a3c --- /dev/null +++ b/libspi/accessible.c @@ -0,0 +1,134 @@ +/* + * accessible.c: test for accessibility implementation + * + */ +#include +#include + +#include + +/* + * This pulls the CORBA definitions for the "Accessibility::Accessible" server + */ +#include "Accessible.h" + +/* + * This pulls the definition for the BonoboObject (Gtk Type) + */ +#include "accessible.h" + +/* + * Our parent Gtk object type + */ +#define PARENT_TYPE BONOBO_X_OBJECT_TYPE + +/* + * A pointer to our parent object class + */ +static GObjectClass *accessible_parent_class; + +/* + * Implemented GObject::finalize + */ +static void +accessible_object_finalize (GObject *object) +{ + Accessible *accessible = ACCESSIBLE (object); + + printf("accessible_object_finalize called\n"); + g_free (accessible->atko); + + printf("atko freed, calling parent finalize\n"); + accessible_parent_class->finalize (object); +} + +/* + * CORBA Accessibility::Accessible::get_name method implementation + */ +static CORBA_char * +impl_accessibility_accessible_get_name (PortableServer_Servant servant, + CORBA_Environment *ev) +{ + CORBA_char * retval; + Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant)); + retval = CORBA_string_dup (atk_object_get_name (accessible->atko)); + fprintf (stderr, "Accessible get_name called: %s\n", retval); + return retval; +} + +/* + * CORBA Accessibility::Accessible::set_name method implementation + */ +static void +impl_accessibility_accessible_set_name (PortableServer_Servant servant, + const CORBA_char *name, + CORBA_Environment *ev) +{ + Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant)); + atk_object_set_name (accessible->atko, name); + printf ("Accessible set_name called: %s\n", name); +} + +static void +accessible_class_init (AccessibleClass *klass) +{ + GObjectClass * object_class = (GObjectClass *) klass; + POA_Accessibility_Accessible__epv *epv = &klass->epv; + accessible_parent_class = g_type_class_ref (BONOBO_X_OBJECT_TYPE); + /*accessible_parent_class = g_type_class_peek_parent (klass);*/ + + object_class->finalize = accessible_object_finalize; + + epv->_get_name = impl_accessibility_accessible_get_name; + epv->_set_name = impl_accessibility_accessible_set_name; +} + +static void +accessible_init (Accessible *accessible) +{ +} + +GType +accessible_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo tinfo = { + sizeof (AccessibleClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) accessible_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class data */ + sizeof (Accessible), + 0, /* n preallocs */ + (GInstanceInitFunc) accessible_init, + NULL /* value table */ + }; + /* + * Here we use bonobo_x_type_unique instead of + * gtk_type_unique, this auto-generates a load of + * CORBA structures for us. All derived types must + * use bonobo_x_type_unique. + */ + type = bonobo_x_type_unique ( + PARENT_TYPE, + POA_Accessibility_Accessible__init, + NULL, + G_STRUCT_OFFSET (AccessibleClass, epv), + &tinfo, + "Accessible"); + } + + return type; +} + +Accessible * +accessible_new (AtkObject *o) +{ + Accessible *retval = + ACCESSIBLE (g_object_new (accessible_get_type (), NULL)); + retval->atko = ATK_OBJECT (o); + return retval; +} diff --git a/libspi/accessible.h b/libspi/accessible.h new file mode 100644 index 0000000..0b202a8 --- /dev/null +++ b/libspi/accessible.h @@ -0,0 +1,37 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +#ifndef ACCESSIBLE_H_ +#define ACCESSIBLE_H_ + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +#define ACCESSIBLE_TYPE (accessible_get_type ()) +#define ACCESSIBLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ACCESSIBLE_TYPE, Accessible)) +#define ACCESSIBLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ACCESSIBLE_TYPE, AccessibleClass)) +#define IS_ACCESSIBLE(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), ACCESSIBLE_TYPE)) +#define IS_ACCESSIBLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ACCESSIBLE_TYPE)) + +typedef struct { + BonoboXObject parent; + AtkObject *atko; +} Accessible; + +typedef struct { + BonoboXObjectClass parent_class; + POA_Accessibility_Accessible__epv epv; +} AccessibleClass; + +GType accessible_get_type (void); +Accessible *accessible_new (AtkObject *o); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* ACCESSIBLE_H_ */ diff --git a/libspi/application.c b/libspi/application.c new file mode 100644 index 0000000..83638a6 --- /dev/null +++ b/libspi/application.c @@ -0,0 +1,81 @@ +/* + * application.c: implements Application.idl + * + */ +#include +#include +#include "atksimpleobject.h" + +/* + * This pulls the CORBA definitions for the "Accessibility::Accessible" server + */ +#include "Desktop.h" + +/* + * This pulls the definition for the BonoboObject (GObject Type) + */ +#include "application.h" + +/* + * Our parent Gtk object type + */ +#define PARENT_TYPE ACCESSIBLE_TYPE + +static void +application_class_init (ApplicationClass *klass) +{ + ; +} + +static void +application_init (Application *application) +{ + ACCESSIBLE (application)->atko = atk_simple_object_new(); +} + +GType +application_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo tinfo = { + sizeof (ApplicationClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) application_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class data */ + sizeof (Application), + 0, /* n preallocs */ + (GInstanceInitFunc) application_init, + NULL /* value table */ + }; + /* + * Here we use bonobo_x_type_unique instead of + * gtk_type_unique, this auto-generates a load of + * CORBA structures for us. All derived types must + * use bonobo_x_type_unique. + */ + type = bonobo_x_type_unique ( + PARENT_TYPE, + POA_Accessibility_Application__init, + NULL, + G_STRUCT_OFFSET (ApplicationClass, epv), + &tinfo, + "Application"); + } + + return type; +} + +Application * +application_new (char *name, char *desc, char *id) +{ + Application *retval = + APPLICATION (g_object_new (application_get_type (), NULL)); + atk_object_set_name (ACCESSIBLE (retval)->atko, CORBA_string_dup (name)); + atk_object_set_description (ACCESSIBLE (retval)->atko, CORBA_string_dup (desc)); + retval->id = CORBA_string_dup (id); + return retval; +} diff --git a/libspi/application.h b/libspi/application.h new file mode 100644 index 0000000..ef8b9b9 --- /dev/null +++ b/libspi/application.h @@ -0,0 +1,37 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +#ifndef APPLICATION_H_ +#define APPLICATION_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include +#include + +#define APPLICATION_TYPE (application_get_type ()) +#define APPLICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), APPLICATION_TYPE, Application)) +#define APPLICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), APPLICATION_TYPE, ApplicationClass)) +#define IS_APPLICATION(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), APPLICATION_TYPE)) +#define IS_APPLICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), APPLICATION_TYPE)) + +typedef struct { + Accessible parent; + char *id; +} Application; + +typedef struct { + AccessibleClass parent_class; + POA_Accessibility_Application__epv epv; +} ApplicationClass; + +GType application_get_type (void); +Application *application_new (char *name, char *desc, char *id); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* APPLICATION_H_ */ diff --git a/libspi/atksimpleobject.c b/libspi/atksimpleobject.c new file mode 100644 index 0000000..23fb2e0 --- /dev/null +++ b/libspi/atksimpleobject.c @@ -0,0 +1,85 @@ +#include "atksimpleobject.h" + +static void atk_simple_object_class_init (AtkSimpleObjectClass *klass); + +static gpointer parent_class = NULL; + +GType +atk_simple_object_get_type (void) +{ + static GType type = 0; + + if (!type) + { + static const GTypeInfo tinfo = + { + sizeof (AtkSimpleObjectClass), + (GBaseInitFunc) NULL, /* base init */ + (GBaseFinalizeFunc) NULL, /* base finalize */ + (GClassInitFunc) atk_simple_object_class_init, /* class init */ + (GClassFinalizeFunc) NULL, /* class finalize */ + NULL, /* class data */ + sizeof (AtkSimpleObject), /* instance size */ + 0, /* nb preallocs */ + (GInstanceInitFunc) NULL, /* instance init */ + NULL /* value table */ + }; + + type = g_type_register_static (ATK_TYPE_OBJECT, + "AtkSimpleObject", &tinfo, 0); + } + return type; +} + +static void +atk_simple_object_set_name (AtkObject *o, const gchar *name) +{ + printf("set name to %s\n", name); + o->name = name; +} + +static G_CONST_RETURN gchar * +atk_simple_object_get_name (AtkObject *o) +{ + printf("get name: %s\n", o->name); + return (o->name); +} + + +static void +atk_simple_object_set_description (AtkObject *o, const gchar *desc) +{ + printf("set description to %s\n", desc); + o->description = desc; +} + +static G_CONST_RETURN gchar * +atk_simple_object_get_description (AtkObject *o) +{ + printf("get description: %s\n", o->description); + return (o->description); +} + +static void +atk_simple_object_class_init (AtkSimpleObjectClass *klass) +{ + AtkObjectClass *oc = ATK_OBJECT_CLASS (klass); + parent_class = g_type_class_ref (ATK_TYPE_OBJECT); + oc->set_name = atk_simple_object_set_name; + oc->get_name = atk_simple_object_get_name; + oc->set_description = atk_simple_object_set_description; + oc->get_description = atk_simple_object_get_description; +} + +AtkObject* +atk_simple_object_new () +{ + GObject *object; + AtkObject* accessible; + + object = g_object_new (ATK_TYPE_SIMPLE_OBJECT, NULL); + accessible = ATK_OBJECT (object); + + return accessible; +} + diff --git a/libspi/atksimpleobject.h b/libspi/atksimpleobject.h new file mode 100644 index 0000000..88c5186 --- /dev/null +++ b/libspi/atksimpleobject.h @@ -0,0 +1,41 @@ +#ifndef __ATK_SIMPLE_OBJECT_H__ +#define __ATK_SIMPLE_OBJECT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include + +#define ATK_TYPE_SIMPLE_OBJECT (atk_simple_object_get_type ()) +#define ATK_SIMPLE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_SIMPLE_OBJECT, AtkSimpleObject)) +#define ATK_SIMPLE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_SIMPLE_OBJECT, AtkSimpleObjectClass)) +#define ATK_IS_SIMPLE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_SIMPLE_OBJECT)) +#define ATK_IS_SIMPLE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_SIMPLE_OBJECT)) +#define ATK_SIMPLE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_SIMPLE_OBJECT, AtkSimpleObjectClass)) + +typedef struct _AtkSimpleObject AtkSimpleObject; +typedef struct _AtkSimpleObjectClass AtkSimpleObjectClass; + +struct _AtkSimpleObject +{ + AtkObject parent; +}; + +GType atk_simple_object_get_type (void); + +struct _AtkSimpleObjectClass +{ + AtkObjectClass parent_class; +}; + +AtkObject *atk_simple_object_new (); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __ATK_SIMPLE_OBJECT_H__ */ + diff --git a/libspi/desktop.c b/libspi/desktop.c new file mode 100644 index 0000000..d013796 --- /dev/null +++ b/libspi/desktop.c @@ -0,0 +1,131 @@ +/* + * desktop.c: implements Desktop.idl + * + */ + +/* #include */ +#include + +#include + +/* + * This pulls the CORBA definitions for the "Accessibility::Accessible" server + */ +#include "Desktop.h" + +/* + * This pulls the definition for the BonoboObject (Gtk Type) + */ +#include "desktop.h" + +/* + * Our parent Gtk object type + */ +#define PARENT_TYPE ACCESSIBLE_TYPE + +/* + * A pointer to our parent object class + */ +static AccessibleClass *parent_class; + +static void +desktop_init (Desktop *desktop) +{ + ACCESSIBLE (desktop)->atko = atk_simple_object_new(); + atk_object_set_name (ATK_OBJECT (ACCESSIBLE (desktop)->atko), "main"); +} + +static CORBA_long +impl_desktop_get_child_count (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + Desktop *desktop = DESKTOP (bonobo_object_from_servant (servant)); + if (desktop->applications) + { + return g_list_length (desktop->applications); + } + else + { + return 0; + } +} + +static Accessibility_Accessible +impl_desktop_get_child_at_index (PortableServer_Servant servant, + const CORBA_long index, + CORBA_Environment * ev) +{ + Desktop *desktop = DESKTOP (bonobo_object_from_servant (servant)); + CORBA_Object retval; + if ((desktop->applications) && (index < g_list_length (desktop->applications))) + { + fprintf (stderr, "getting application %ld\n", (long) index); + /* */ + fprintf (stderr, "object address %p\n", + g_list_nth_data (desktop->applications, index)); + retval = CORBA_Object_duplicate ( + (CORBA_Object) g_list_nth_data (desktop->applications, index), ev); + } + else + { + fprintf (stderr, "no %ldth child\n", (long) index); + retval = CORBA_OBJECT_NIL; + } + return (Accessibility_Accessible) retval; +} + +static void +desktop_class_init (DesktopClass *klass) +{ + AccessibleClass * accessible_class = (AccessibleClass *) klass; + POA_Accessibility_Accessible__epv *epv = &accessible_class->epv; + + parent_class = g_type_class_ref (ACCESSIBLE_TYPE); + + epv->_get_childCount = impl_desktop_get_child_count; + epv->getChildAtIndex = impl_desktop_get_child_at_index; +} + +GType +desktop_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo tinfo = { + sizeof (DesktopClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) desktop_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class data */ + sizeof (Desktop), + 0, /* n preallocs */ + (GInstanceInitFunc) desktop_init, + NULL /* value table */ + }; + /* + * Here we use bonobo_x_type_unique instead of + * gtk_type_unique, this auto-generates a load of + * CORBA structures for us. All derived types must + * use bonobo_x_type_unique. + */ + type = bonobo_x_type_unique ( + PARENT_TYPE, + POA_Accessibility_Desktop__init, + NULL, + G_STRUCT_OFFSET (DesktopClass, epv), + &tinfo, + "Desktop"); + } + + return type; +} + +Desktop * +desktop_new (void) +{ + Desktop *retval = + DESKTOP (g_object_new (desktop_get_type (), NULL)); + return retval; +} diff --git a/libspi/desktop.h b/libspi/desktop.h new file mode 100644 index 0000000..63c4b60 --- /dev/null +++ b/libspi/desktop.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +#ifndef DESKTOP_H_ +#define DESKTOP_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include +#include +#include +#include + +#define DESKTOP_TYPE (desktop_get_type ()) +#define DESKTOP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DESKTOP_TYPE, Desktop)) +#define DESKTOP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DESKTOP_TYPE, DesktopClass)) +#define IS_DESKTOP(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), DESKTOP_TYPE)) +#define IS_DESKTOP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DESKTOP_TYPE)) + +typedef struct { + Accessible parent; + GList *applications; /* TODO: maybe change this so it's generated on-demand ? */ +} Desktop; + +typedef struct { + AccessibleClass parent_class; + POA_Accessibility_Desktop__epv epv; +} DesktopClass; + +GType desktop_get_type (void); +void desktop_add_application (Application *app); +void desktop_remove_application (Application *app); +Desktop *desktop_new (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* DESKTOP_H_ */ diff --git a/libspi/listener.c b/libspi/listener.c new file mode 100644 index 0000000..785eaa9 --- /dev/null +++ b/libspi/listener.c @@ -0,0 +1,114 @@ +/* + * listener.c: test for accessibility implementation + * + */ +#define DEBUG_PRINTSTUFF +#ifdef DEBUG_PRINTSTUFF +#include +#endif +#include +#include +#include + +/* + * This pulls the definition for the BonoboObject (GType) + */ +#include "listener.h" + +/* + * Our parent Gtk object type + */ +#define PARENT_TYPE BONOBO_X_OBJECT_TYPE + +/* + * A pointer to our parent object class + */ +static GObjectClass *listener_parent_class; + +/* + * Implemented GObject::finalize + */ +static void +listener_object_finalize (GObject *object) +{ +/* Listener *listener = LISTENER (object); */ + + printf("listener_object_finalize called\n"); + + listener_parent_class->finalize (object); +} + +/* + * CORBA Accessibility::Listener::notifyEvent method implementation + */ + +static void +impl_notify_event (PortableServer_Servant servant, + const Accessibility_Event *e, + CORBA_Environment *ev) +{ + fprintf (stderr, "notify...\n"); + fprintf (stderr, "source name: '%s'\n", + Accessibility_Accessible__get_name(e->target, ev)); +} + +static void +listener_class_init (ListenerClass *klass) +{ + GObjectClass * object_class = (GObjectClass *) klass; + POA_Accessibility_EventListener__epv *epv = &klass->epv; + listener_parent_class = g_type_class_ref (BONOBO_X_OBJECT_TYPE); + + object_class->finalize = listener_object_finalize; + + epv->notifyEvent = impl_notify_event; +} + +static void +listener_init (Listener *listener) +{ +} + +GType +listener_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo tinfo = { + sizeof (ListenerClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) listener_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class data */ + sizeof (Listener), + 0, /* n preallocs */ + (GInstanceInitFunc) listener_init, + NULL /* value table */ + }; + /* + * Here we use bonobo_x_type_unique instead of + * gtk_type_unique, this auto-generates a load of + * CORBA structures for us. All derived types must + * use bonobo_x_type_unique. + */ + type = bonobo_x_type_unique ( + PARENT_TYPE, + POA_Accessibility_EventListener__init, + NULL, + G_STRUCT_OFFSET (ListenerClass, epv), + &tinfo, + "Listener"); + } + + return type; +} + +Listener * +listener_new (void) +{ + Listener *retval = + LISTENER (g_object_new (listener_get_type (), NULL)); + return retval; +} diff --git a/libspi/listener.h b/libspi/listener.h new file mode 100644 index 0000000..da23d6c --- /dev/null +++ b/libspi/listener.h @@ -0,0 +1,34 @@ +#ifndef LISTENER_H_ +#define LISTENER_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include + +#define LISTENER_TYPE (listener_get_type ()) +#define LISTENER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), LISTENER_TYPE, Listener)) +#define LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), LISTENER_TYPE, ListenerClass)) +#define IS_LISTENER(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), LISTENER_TYPE)) +#define IS_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), LISTENER_TYPE)) + +typedef struct { + BonoboXObject parent; +} Listener; + +typedef struct { + BonoboXObjectClass parent_class; + POA_Accessibility_EventListener__epv epv; +} ListenerClass; + +GType listener_get_type (void); +Listener *listener_new (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LISTENER_H_ */ diff --git a/libspi/registry.c b/libspi/registry.c new file mode 100644 index 0000000..71999af --- /dev/null +++ b/libspi/registry.c @@ -0,0 +1,303 @@ +/* + * registry.c: test for accessibility implementation + * + */ +#define DEBUG_PRINTSTUFF +#ifdef DEBUG_PRINTSTUFF +#include +#endif +#include +#include + +/* + * This pulls the CORBA definitions for the "Accessibility::Registry" server + */ +#include "Registry.h" + +/* + * This pulls the definition for the BonoboObject (GType) + */ +#include "registry.h" + +/* + * Our parent GObject type + */ +#define PARENT_TYPE LISTENER_TYPE + +/* + * A pointer to our parent object class + */ +static ListenerClass *registry_parent_class; + +/* + * Implemented GObject::finalize + */ +static void +registry_object_finalize (GObject *object) +{ +/* Registry *registry = REGISTRY (object); */ + GObjectClass *object_class = G_OBJECT_GET_CLASS( object); + + printf("registry_object_finalize called\n"); + + object_class->finalize (object); +} + +/** + * registerApplication: + * @application: a reference to the requesting @Application + * return values: void + * + * Register a new application with the accessibility broker. + * + **/ +static void +impl_accessibility_registry_register_application (PortableServer_Servant servant, + const Accessibility_Application application, + CORBA_Environment * ev) +{ + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + + fprintf (stderr, "registering app %p\n", application); + registry->desktop->applications = g_list_append (registry->desktop->applications, CORBA_Object_duplicate (application, ev)); + /* + * TODO: change the implementation below to a WM-aware one; + * e.g. don't add all apps to the Desktop + */ + /* registry->desktop->applications = registry->applications;*/ +} + +/** + * deregisterApplication: + * @application: a reference to the @Application + * to be deregistered. + * return values: void + * + * De-register an application previously registered with the broker. + * + **/ +static void +impl_accessibility_registry_deregister_application (PortableServer_Servant servant, + const Accessibility_Application application, + CORBA_Environment * ev) +{ + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + registry->applications = g_list_remove (registry->applications, application); +} + +/* + * CORBA Accessibility::Registry::registerGlobalEventListener method implementation + */ +static void +impl_accessibility_registry_register_global_event_listener + (PortableServer_Servant servant, + Accessibility_EventListener listener, + const CORBA_char *event_name, + CORBA_Environment *ev) +{ + /** + * TODO: + * + * distinguish between event types + * register with app toolkits only for requested event types + * maintain list of requested types and number of listeners + * find non-strcmp method of matching event types to listeners + * + **/ + + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + /* fprintf(stderr, "registering %x/%x\n", listener, *listener); */ + registry->listeners = g_list_append (registry->listeners, CORBA_Object_duplicate(listener, ev)); + /* fprintf(stderr, "there are now %d listeners registered.\n", g_list_length(registry->listeners)); */ + /* should use hashtable and CORBA_Object_hash (...) */ +} + +/* + * CORBA Accessibility::Registry::deregisterGlobalEventListener method implementation + */ +static void +impl_accessibility_registry_deregister_global_event_listener + (PortableServer_Servant servant, + Accessibility_EventListener listener, + CORBA_Environment *ev) +{ + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + /* TODO: this won't work since 'listener' is a duplicate ref */ + registry->listeners = g_list_remove (registry->listeners, listener); + /* fprintf(stderr, "deregister\n"); */ +} + + +/** + * getDesktopCount: + * return values: a short integer indicating the current number of + * @Desktops. + * + * Get the current number of desktops. + * + **/ +static short +impl_accessibility_registry_get_desktop_count (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + /* TODO: implement support for multiple virtual desktops */ + CORBA_short n_desktops; + n_desktops = (CORBA_short) 1; + return n_desktops; +} + +/** + * getDesktop: + * @n: the index of the requested @Desktop. + * return values: a reference to the requested @Desktop. + * + * Get the nth accessible desktop. + * + **/ +static Accessibility_Desktop +impl_accessibility_registry_get_desktop (PortableServer_Servant servant, + const CORBA_short n, + CORBA_Environment * ev) +{ + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + + /* TODO: implement support for multiple virtual desktops */ + if (n == 0) + { + return (Accessibility_Desktop) + CORBA_Object_duplicate ( + bonobo_object_corba_objref (bonobo_object (registry->desktop)), ev); + } + else + { + return (Accessibility_Desktop) CORBA_OBJECT_NIL; + } +} + +/** + * getDesktopList: + * return values: a sequence containing references to + * the @Desktops. + * + * Get a list of accessible desktops. + * + **/ +static Accessibility_DesktopSeq * +impl_accessibility_registry_get_desktop_list (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + /* TODO: implement support for multiple virtual desktops */ + return (Accessibility_DesktopSeq *) NULL; +} + +static CORBA_Object +impl_accessibility_registry_get_device_event_controller (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + /* TODO: not yet implemented! */ + return CORBA_OBJECT_NIL; +} + +static void +impl_registry_notify_event (PortableServer_Servant servant, + const Accessibility_Event *e, + CORBA_Environment *ev) +{ + int n; + int len; + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + + /** + * TODO: + * + * distinguish between event types + * find non-strcmp method of matching event types to listeners + * + **/ + + len = g_list_length (registry->listeners); + /* fprintf(stderr, "%d listeners registered\n", len); */ + + for (n=0; ntarget, ev));*/ + Accessibility_EventListener_notifyEvent ( + (Accessibility_EventListener) g_list_nth_data (registry->listeners, n), + e, + ev); + } +} + +static void +registry_class_init (RegistryClass *klass) +{ + GObjectClass * object_class = (GObjectClass *) klass; + POA_Accessibility_Registry__epv *epv = &klass->epv; + + registry_parent_class = g_type_class_ref (LISTENER_TYPE); + + object_class->finalize = registry_object_finalize; + + epv->registerApplication = impl_accessibility_registry_register_application; + epv->deregisterApplication = impl_accessibility_registry_deregister_application; + epv->registerGlobalEventListener = impl_accessibility_registry_register_global_event_listener; + epv->deregisterGlobalEventListener = impl_accessibility_registry_deregister_global_event_listener; + epv->getDesktopCount = impl_accessibility_registry_get_desktop_count; + epv->getDesktop = impl_accessibility_registry_get_desktop; + epv->getDesktopList = impl_accessibility_registry_get_desktop_list; + epv->getDeviceEventController = impl_accessibility_registry_get_device_event_controller; + ((ListenerClass *) klass)->epv.notifyEvent = impl_registry_notify_event; +} + +static void +registry_init (Registry *registry) +{ + registry->listeners = NULL; + registry->applications = NULL; + registry->desktop = desktop_new(); +} + +GType +registry_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo tinfo = { + sizeof (RegistryClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) registry_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class data */ + sizeof (Registry), + 0, /* n preallocs */ + (GInstanceInitFunc) registry_init, + NULL /* value table */ + }; + /* + * Here we use bonobo_x_type_unique instead of + * gtk_type_unique, this auto-generates a load of + * CORBA structures for us. All derived types must + * use bonobo_x_type_unique. + */ + type = bonobo_x_type_unique ( + PARENT_TYPE, + POA_Accessibility_Registry__init, + NULL, + G_STRUCT_OFFSET (RegistryClass, epv), + &tinfo, + "Registry"); + } + + return type; +} + +Registry * +registry_new (void) +{ + Registry *retval = + REGISTRY (g_object_new (registry_get_type (), NULL)); + return retval; +} diff --git a/libspi/registry.h b/libspi/registry.h new file mode 100644 index 0000000..a6c9100 --- /dev/null +++ b/libspi/registry.h @@ -0,0 +1,37 @@ +#ifndef REGISTRY_H_ +#define REGISTRY_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include "listener.h" +#include "desktop.h" + +#define REGISTRY_TYPE (registry_get_type ()) +#define REGISTRY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), REGISTRY_TYPE, Registry)) +#define REGISTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), REGISTRY_TYPE, RegistryClass)) +#define IS_REGISTRY(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), REGISTRY_TYPE)) +#define IS_REGISTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), REGISTRY_TYPE)) + +typedef struct { + Listener parent; + GList *listeners; + GList *applications; + Desktop *desktop; +} Registry; + +typedef struct { + ListenerClass parent_class; + POA_Accessibility_Registry__epv epv; +} RegistryClass; + +GType registry_get_type (void); +Registry *registry_new (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* REGISTRY_H_ */ diff --git a/po/.cvsignore b/po/.cvsignore new file mode 100644 index 0000000..34cb787 --- /dev/null +++ b/po/.cvsignore @@ -0,0 +1,7 @@ +*~ +Makefile +Makefile.in +Makefile.in.in.orig +stamp-cat-id +cat-id-tbl.c +POTFILES diff --git a/po/Makefile.in.in b/po/Makefile.in.in new file mode 100644 index 0000000..4d6df83 --- /dev/null +++ b/po/Makefile.in.in @@ -0,0 +1,261 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = .. +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = $(prefix)/@DATADIRNAME@ +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext/po +subdir = po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ + +CC = @CC@ +GENCAT = @GENCAT@ +GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ +XML_I18N_UPDATE = @XML_I18N_UPDATE@ +XML_I18N_EXTRACT = @XML_I18N_EXTRACT@ + +MSGMERGE = XML_I18N_EXTRACT=$(XML_I18N_EXTRACT) $(XML_I18N_UPDATE) --dist +GENPOT = XML_I18N_EXTRACT=$(XML_I18N_EXTRACT) $(XML_I18N_UPDATE) --pot + + +DEFS = @DEFS@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +INSTOBJEXT = @INSTOBJEXT@ + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: all-@USE_NLS@ + +all-yes: cat-id-tbl.c $(CATALOGS) +all-no: + +$(srcdir)/$(PACKAGE).pot: $(POTFILES) + $(GENPOT) + +$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: +$(srcdir)/stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp + if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ +install-data-no: all +install-data-yes: all + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(datadir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \ + fi + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + case "$$cat" in \ + *.gmo) destdir=$(gnulocaledir);; \ + *) destdir=$(localedir);; \ + esac; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $$dir; \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ + fi; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + fi; \ + if test -r $$cat.m; then \ + $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + if test -r $(srcdir)/$$cat.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$cat.m \ + $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + true; \ + fi; \ + fi; \ + done + if test "$(PACKAGE)" = "gettext"; then \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(gettextsrcdir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + fi; \ + $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ + $(gettextsrcdir)/Makefile.in.in; \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +dvi info tags TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(GMOFILES) + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: update-po $(DISTFILES) + dists="$(DISTFILES)"; \ + for file in $$dists; do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + PATH=`pwd`/../src:$$PATH; \ + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + cp $$lang.po $$lang.old.po; \ + echo "$$lang:"; \ + if $(MSGMERGE) $$lang; then \ + rm -f $$lang.old.po; \ + else \ + echo "msgmerge for $$cat failed!"; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +.po: Makefile + $(MAKE) $(PACKAGE).pot; + PATH=`pwd`/../src:$$PATH; \ + echo; printf "$*: "; \ + if $(MSGMERGE) $*; then \ + rm -f $*.old.po; \ + else \ + echo "msgmerge for * failed!"; \ + mv $*.old.po $*.po; \ + fi; \ + msgfmt --statistics $*.po; echo; + + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + rm -f $@-t $@ \ + && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ + | sed -e '$$s/\\$$//') > $@-t \ + && chmod a-w $@-t \ + && mv $@-t $@ ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..e69de29 diff --git a/registryd/.cvsignore b/registryd/.cvsignore new file mode 100644 index 0000000..70845e0 --- /dev/null +++ b/registryd/.cvsignore @@ -0,0 +1 @@ +Makefile.in diff --git a/registryd/Accessibility_Registry.oaf.in b/registryd/Accessibility_Registry.oaf.in new file mode 100644 index 0000000..5004441 --- /dev/null +++ b/registryd/Accessibility_Registry.oaf.in @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/registryd/Accessibility_Registry.server.in b/registryd/Accessibility_Registry.server.in new file mode 100644 index 0000000..5004441 --- /dev/null +++ b/registryd/Accessibility_Registry.server.in @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/registryd/Makefile.am b/registryd/Makefile.am new file mode 100644 index 0000000..800f35f --- /dev/null +++ b/registryd/Makefile.am @@ -0,0 +1,18 @@ +bin_PROGRAMS = registryd + +INCLUDES = -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_builddir)/libspi \ + -I$(top_srcdir)/libspi \ + $(REGISTRYD_CFLAGS) + +at_registryd_SOURCES = registryd.c + +LDADD = ../libspi/libspi.la $(REGISTRYD_LIBS) + +oafinfodir = $(datadir)/oaf +oafinfo_DATA = Accessibility_Registry.oaf + +@XML_I18N_MERGE_OAF_RULE@ + +EXTRA_DIST = Accessibility_Registry.oaf.in $(oafinfo_DATA) diff --git a/registryd/desktop.c b/registryd/desktop.c new file mode 100644 index 0000000..d013796 --- /dev/null +++ b/registryd/desktop.c @@ -0,0 +1,131 @@ +/* + * desktop.c: implements Desktop.idl + * + */ + +/* #include */ +#include + +#include + +/* + * This pulls the CORBA definitions for the "Accessibility::Accessible" server + */ +#include "Desktop.h" + +/* + * This pulls the definition for the BonoboObject (Gtk Type) + */ +#include "desktop.h" + +/* + * Our parent Gtk object type + */ +#define PARENT_TYPE ACCESSIBLE_TYPE + +/* + * A pointer to our parent object class + */ +static AccessibleClass *parent_class; + +static void +desktop_init (Desktop *desktop) +{ + ACCESSIBLE (desktop)->atko = atk_simple_object_new(); + atk_object_set_name (ATK_OBJECT (ACCESSIBLE (desktop)->atko), "main"); +} + +static CORBA_long +impl_desktop_get_child_count (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + Desktop *desktop = DESKTOP (bonobo_object_from_servant (servant)); + if (desktop->applications) + { + return g_list_length (desktop->applications); + } + else + { + return 0; + } +} + +static Accessibility_Accessible +impl_desktop_get_child_at_index (PortableServer_Servant servant, + const CORBA_long index, + CORBA_Environment * ev) +{ + Desktop *desktop = DESKTOP (bonobo_object_from_servant (servant)); + CORBA_Object retval; + if ((desktop->applications) && (index < g_list_length (desktop->applications))) + { + fprintf (stderr, "getting application %ld\n", (long) index); + /* */ + fprintf (stderr, "object address %p\n", + g_list_nth_data (desktop->applications, index)); + retval = CORBA_Object_duplicate ( + (CORBA_Object) g_list_nth_data (desktop->applications, index), ev); + } + else + { + fprintf (stderr, "no %ldth child\n", (long) index); + retval = CORBA_OBJECT_NIL; + } + return (Accessibility_Accessible) retval; +} + +static void +desktop_class_init (DesktopClass *klass) +{ + AccessibleClass * accessible_class = (AccessibleClass *) klass; + POA_Accessibility_Accessible__epv *epv = &accessible_class->epv; + + parent_class = g_type_class_ref (ACCESSIBLE_TYPE); + + epv->_get_childCount = impl_desktop_get_child_count; + epv->getChildAtIndex = impl_desktop_get_child_at_index; +} + +GType +desktop_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo tinfo = { + sizeof (DesktopClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) desktop_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class data */ + sizeof (Desktop), + 0, /* n preallocs */ + (GInstanceInitFunc) desktop_init, + NULL /* value table */ + }; + /* + * Here we use bonobo_x_type_unique instead of + * gtk_type_unique, this auto-generates a load of + * CORBA structures for us. All derived types must + * use bonobo_x_type_unique. + */ + type = bonobo_x_type_unique ( + PARENT_TYPE, + POA_Accessibility_Desktop__init, + NULL, + G_STRUCT_OFFSET (DesktopClass, epv), + &tinfo, + "Desktop"); + } + + return type; +} + +Desktop * +desktop_new (void) +{ + Desktop *retval = + DESKTOP (g_object_new (desktop_get_type (), NULL)); + return retval; +} diff --git a/registryd/desktop.h b/registryd/desktop.h new file mode 100644 index 0000000..63c4b60 --- /dev/null +++ b/registryd/desktop.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +#ifndef DESKTOP_H_ +#define DESKTOP_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include +#include +#include +#include +#include + +#define DESKTOP_TYPE (desktop_get_type ()) +#define DESKTOP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DESKTOP_TYPE, Desktop)) +#define DESKTOP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DESKTOP_TYPE, DesktopClass)) +#define IS_DESKTOP(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), DESKTOP_TYPE)) +#define IS_DESKTOP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DESKTOP_TYPE)) + +typedef struct { + Accessible parent; + GList *applications; /* TODO: maybe change this so it's generated on-demand ? */ +} Desktop; + +typedef struct { + AccessibleClass parent_class; + POA_Accessibility_Desktop__epv epv; +} DesktopClass; + +GType desktop_get_type (void); +void desktop_add_application (Application *app); +void desktop_remove_application (Application *app); +Desktop *desktop_new (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* DESKTOP_H_ */ diff --git a/registryd/registry-main.c b/registryd/registry-main.c new file mode 100644 index 0000000..d9fc572 --- /dev/null +++ b/registryd/registry-main.c @@ -0,0 +1,32 @@ +#include +#include +#include "registry.h" + +int +main (int argc, + char **argv) +{ + Registry *registry; + char *obj_id; + + if (!bonobo_init (&argc, argv)) + { + g_error ("Could not initialize oaf / Bonobo"); + } + + obj_id = "OAFIID:Accessibility_Registry:proto0.1"; + + registry = registry_new (); + + oaf_active_server_register ( + obj_id, + bonobo_object_corba_objref (bonobo_object (registry))); + + fprintf (stderr, "Registry Message: Registry daemon is running.\n"); + bonobo_main (); + + return 0; +} + + + diff --git a/registryd/registry.c b/registryd/registry.c new file mode 100644 index 0000000..71999af --- /dev/null +++ b/registryd/registry.c @@ -0,0 +1,303 @@ +/* + * registry.c: test for accessibility implementation + * + */ +#define DEBUG_PRINTSTUFF +#ifdef DEBUG_PRINTSTUFF +#include +#endif +#include +#include + +/* + * This pulls the CORBA definitions for the "Accessibility::Registry" server + */ +#include "Registry.h" + +/* + * This pulls the definition for the BonoboObject (GType) + */ +#include "registry.h" + +/* + * Our parent GObject type + */ +#define PARENT_TYPE LISTENER_TYPE + +/* + * A pointer to our parent object class + */ +static ListenerClass *registry_parent_class; + +/* + * Implemented GObject::finalize + */ +static void +registry_object_finalize (GObject *object) +{ +/* Registry *registry = REGISTRY (object); */ + GObjectClass *object_class = G_OBJECT_GET_CLASS( object); + + printf("registry_object_finalize called\n"); + + object_class->finalize (object); +} + +/** + * registerApplication: + * @application: a reference to the requesting @Application + * return values: void + * + * Register a new application with the accessibility broker. + * + **/ +static void +impl_accessibility_registry_register_application (PortableServer_Servant servant, + const Accessibility_Application application, + CORBA_Environment * ev) +{ + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + + fprintf (stderr, "registering app %p\n", application); + registry->desktop->applications = g_list_append (registry->desktop->applications, CORBA_Object_duplicate (application, ev)); + /* + * TODO: change the implementation below to a WM-aware one; + * e.g. don't add all apps to the Desktop + */ + /* registry->desktop->applications = registry->applications;*/ +} + +/** + * deregisterApplication: + * @application: a reference to the @Application + * to be deregistered. + * return values: void + * + * De-register an application previously registered with the broker. + * + **/ +static void +impl_accessibility_registry_deregister_application (PortableServer_Servant servant, + const Accessibility_Application application, + CORBA_Environment * ev) +{ + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + registry->applications = g_list_remove (registry->applications, application); +} + +/* + * CORBA Accessibility::Registry::registerGlobalEventListener method implementation + */ +static void +impl_accessibility_registry_register_global_event_listener + (PortableServer_Servant servant, + Accessibility_EventListener listener, + const CORBA_char *event_name, + CORBA_Environment *ev) +{ + /** + * TODO: + * + * distinguish between event types + * register with app toolkits only for requested event types + * maintain list of requested types and number of listeners + * find non-strcmp method of matching event types to listeners + * + **/ + + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + /* fprintf(stderr, "registering %x/%x\n", listener, *listener); */ + registry->listeners = g_list_append (registry->listeners, CORBA_Object_duplicate(listener, ev)); + /* fprintf(stderr, "there are now %d listeners registered.\n", g_list_length(registry->listeners)); */ + /* should use hashtable and CORBA_Object_hash (...) */ +} + +/* + * CORBA Accessibility::Registry::deregisterGlobalEventListener method implementation + */ +static void +impl_accessibility_registry_deregister_global_event_listener + (PortableServer_Servant servant, + Accessibility_EventListener listener, + CORBA_Environment *ev) +{ + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + /* TODO: this won't work since 'listener' is a duplicate ref */ + registry->listeners = g_list_remove (registry->listeners, listener); + /* fprintf(stderr, "deregister\n"); */ +} + + +/** + * getDesktopCount: + * return values: a short integer indicating the current number of + * @Desktops. + * + * Get the current number of desktops. + * + **/ +static short +impl_accessibility_registry_get_desktop_count (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + /* TODO: implement support for multiple virtual desktops */ + CORBA_short n_desktops; + n_desktops = (CORBA_short) 1; + return n_desktops; +} + +/** + * getDesktop: + * @n: the index of the requested @Desktop. + * return values: a reference to the requested @Desktop. + * + * Get the nth accessible desktop. + * + **/ +static Accessibility_Desktop +impl_accessibility_registry_get_desktop (PortableServer_Servant servant, + const CORBA_short n, + CORBA_Environment * ev) +{ + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + + /* TODO: implement support for multiple virtual desktops */ + if (n == 0) + { + return (Accessibility_Desktop) + CORBA_Object_duplicate ( + bonobo_object_corba_objref (bonobo_object (registry->desktop)), ev); + } + else + { + return (Accessibility_Desktop) CORBA_OBJECT_NIL; + } +} + +/** + * getDesktopList: + * return values: a sequence containing references to + * the @Desktops. + * + * Get a list of accessible desktops. + * + **/ +static Accessibility_DesktopSeq * +impl_accessibility_registry_get_desktop_list (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + /* TODO: implement support for multiple virtual desktops */ + return (Accessibility_DesktopSeq *) NULL; +} + +static CORBA_Object +impl_accessibility_registry_get_device_event_controller (PortableServer_Servant servant, + CORBA_Environment * ev) +{ + /* TODO: not yet implemented! */ + return CORBA_OBJECT_NIL; +} + +static void +impl_registry_notify_event (PortableServer_Servant servant, + const Accessibility_Event *e, + CORBA_Environment *ev) +{ + int n; + int len; + Registry *registry = REGISTRY (bonobo_object_from_servant (servant)); + + /** + * TODO: + * + * distinguish between event types + * find non-strcmp method of matching event types to listeners + * + **/ + + len = g_list_length (registry->listeners); + /* fprintf(stderr, "%d listeners registered\n", len); */ + + for (n=0; ntarget, ev));*/ + Accessibility_EventListener_notifyEvent ( + (Accessibility_EventListener) g_list_nth_data (registry->listeners, n), + e, + ev); + } +} + +static void +registry_class_init (RegistryClass *klass) +{ + GObjectClass * object_class = (GObjectClass *) klass; + POA_Accessibility_Registry__epv *epv = &klass->epv; + + registry_parent_class = g_type_class_ref (LISTENER_TYPE); + + object_class->finalize = registry_object_finalize; + + epv->registerApplication = impl_accessibility_registry_register_application; + epv->deregisterApplication = impl_accessibility_registry_deregister_application; + epv->registerGlobalEventListener = impl_accessibility_registry_register_global_event_listener; + epv->deregisterGlobalEventListener = impl_accessibility_registry_deregister_global_event_listener; + epv->getDesktopCount = impl_accessibility_registry_get_desktop_count; + epv->getDesktop = impl_accessibility_registry_get_desktop; + epv->getDesktopList = impl_accessibility_registry_get_desktop_list; + epv->getDeviceEventController = impl_accessibility_registry_get_device_event_controller; + ((ListenerClass *) klass)->epv.notifyEvent = impl_registry_notify_event; +} + +static void +registry_init (Registry *registry) +{ + registry->listeners = NULL; + registry->applications = NULL; + registry->desktop = desktop_new(); +} + +GType +registry_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo tinfo = { + sizeof (RegistryClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) registry_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class data */ + sizeof (Registry), + 0, /* n preallocs */ + (GInstanceInitFunc) registry_init, + NULL /* value table */ + }; + /* + * Here we use bonobo_x_type_unique instead of + * gtk_type_unique, this auto-generates a load of + * CORBA structures for us. All derived types must + * use bonobo_x_type_unique. + */ + type = bonobo_x_type_unique ( + PARENT_TYPE, + POA_Accessibility_Registry__init, + NULL, + G_STRUCT_OFFSET (RegistryClass, epv), + &tinfo, + "Registry"); + } + + return type; +} + +Registry * +registry_new (void) +{ + Registry *retval = + REGISTRY (g_object_new (registry_get_type (), NULL)); + return retval; +} diff --git a/registryd/registry.h b/registryd/registry.h new file mode 100644 index 0000000..a6c9100 --- /dev/null +++ b/registryd/registry.h @@ -0,0 +1,37 @@ +#ifndef REGISTRY_H_ +#define REGISTRY_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include "listener.h" +#include "desktop.h" + +#define REGISTRY_TYPE (registry_get_type ()) +#define REGISTRY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), REGISTRY_TYPE, Registry)) +#define REGISTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), REGISTRY_TYPE, RegistryClass)) +#define IS_REGISTRY(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), REGISTRY_TYPE)) +#define IS_REGISTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), REGISTRY_TYPE)) + +typedef struct { + Listener parent; + GList *listeners; + GList *applications; + Desktop *desktop; +} Registry; + +typedef struct { + ListenerClass parent_class; + POA_Accessibility_Registry__epv epv; +} RegistryClass; + +GType registry_get_type (void); +Registry *registry_new (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* REGISTRY_H_ */ diff --git a/registryd/registryd.c b/registryd/registryd.c new file mode 100644 index 0000000..d9fc572 --- /dev/null +++ b/registryd/registryd.c @@ -0,0 +1,32 @@ +#include +#include +#include "registry.h" + +int +main (int argc, + char **argv) +{ + Registry *registry; + char *obj_id; + + if (!bonobo_init (&argc, argv)) + { + g_error ("Could not initialize oaf / Bonobo"); + } + + obj_id = "OAFIID:Accessibility_Registry:proto0.1"; + + registry = registry_new (); + + oaf_active_server_register ( + obj_id, + bonobo_object_corba_objref (bonobo_object (registry))); + + fprintf (stderr, "Registry Message: Registry daemon is running.\n"); + bonobo_main (); + + return 0; +} + + + diff --git a/test/.cvsignore b/test/.cvsignore new file mode 100644 index 0000000..70845e0 --- /dev/null +++ b/test/.cvsignore @@ -0,0 +1 @@ +Makefile.in diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..22a35b9 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,15 @@ +NULL= + +noinst_PROGRAMS = at app + +at_SOURCES = at.c + +app_SOURCES = app.c + +INCLUDES = -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/libspi \ + -I$(top_builddir)/libspi \ + $(TESTS_CFLAGS) + +LDADD = ../libspi/libspi.la $(TESTS_LIBS) diff --git a/test/app.c b/test/app.c new file mode 100644 index 0000000..b42508e --- /dev/null +++ b/test/app.c @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include "Registry.h" +#include "Event.h" +#include "accessible.h" +#include "atksimpleobject.h" +#include "application.h" + +int +main(int argc, char **argv) +{ + CORBA_Environment ev; + CORBA_Object oclient; + AtkObject *atko; + char *obj_id; + char sbuf[30]; + + Accessibility_Registry registry; + Accessibility_Event e; + Accessible *accessible; + Application *app; + + CORBA_exception_init(&ev); + + if (!bonobo_init (&argc, argv)) + { + g_error ("Could not initialize Bonobo"); + } + + /* Create the accesssible application server object */ + /* TODO: get app name and pid */ + sprintf(sbuf, "application-%s", argv[1]); + app = application_new(sbuf, "test application for accessibility SPI", "0001"); + + /* Create the Accessible 'source' for the event */ + atko = atk_simple_object_new (); + atk_object_set_name (atko, "dummy"); + accessible = accessible_new (atko); + fprintf(stderr, "accessible created.\n"); + + /* FIXME: this type of event struct will leak, needs to be redefined */ + e.target = bonobo_object_corba_objref ( bonobo_object (accessible)); + e.type = CORBA_string_dup ("test"); + + obj_id = "OAFIID:Accessibility_Registry:proto0.1"; + + oclient = oaf_activate_from_id (obj_id, 0, NULL, &ev); + if (ev._major != CORBA_NO_EXCEPTION) { + fprintf(stderr, + ("Accessibility app error: exception during registry activation from id: %s\n"), + CORBA_exception_id(&ev)); + CORBA_exception_free(&ev); + exit(-1); + } + + if (CORBA_Object_is_nil (oclient, &ev)) + { + g_error ("Could not locate registry"); + } + + registry = (Accessibility_Registry) oclient; + + Accessibility_Registry_registerApplication (registry, + bonobo_object_corba_objref (bonobo_object (app)), + &ev); + fprintf(stderr, "registerApplication has been called.\n"); + + Accessibility_Registry_notifyEvent (registry, &e, &ev); + fprintf (stderr, "notify event has been called.\n"); + + bonobo_main (); /* needed when app becomes a server ? */ + exit(0); +} diff --git a/test/at.c b/test/at.c new file mode 100644 index 0000000..9757f25 --- /dev/null +++ b/test/at.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include "Registry.h" +#include "Event.h" +#include "accessible.h" +#include "listener.h" +#include "desktop.h" + +int +main(int argc, char **argv) +{ + CORBA_Environment ev; + CORBA_Object oclient; + char *obj_id; + CORBA_long i; + CORBA_short n_desktops; + CORBA_long j; + CORBA_long n_apps; + Accessibility_Desktop desktop; + Accessibility_Application app; + + Accessibility_Registry registry; + Listener *listener; + + CORBA_exception_init(&ev); + + if (!bonobo_init (&argc, argv)) + { + g_error ("Could not initialize Bonobo"); + } + + obj_id = "OAFIID:Accessibility_Registry:proto0.1"; + + oclient = oaf_activate_from_id (obj_id, 0, NULL, &ev); + if (ev._major != CORBA_NO_EXCEPTION) { + fprintf(stderr, + ("Accessibility app error: exception during registry activation from id: %s\n"), + CORBA_exception_id(&ev)); + CORBA_exception_free(&ev); + exit(-1); + } + + if (CORBA_Object_is_nil (oclient, &ev)) + { + g_error ("Could not locate registry"); + } + + bonobo_activate (); + + listener = listener_new (); + + registry = (Accessibility_Registry) oclient; + + Accessibility_Registry_registerGlobalEventListener + (registry, + (Accessibility_EventListener) + bonobo_object_corba_objref (bonobo_object (listener)), + "test", + &ev); + + fprintf (stderr, "AT callback registered.\n"); + + + n_desktops = Accessibility_Registry_getDesktopCount (registry, &ev); + + for (i=0; i