gtk/docs/reference/gdk/tmpl/input_devices.sgml
Tim Janik d69496c060 urg, removed implementation of gtk_marshal_VOID__INT_INT_INT_INT. if
Wed Oct 25 20:47:41 2000  Tim Janik  <timj@gtk.org>

        * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init): urg, removed
        implementation of gtk_marshal_VOID__INT_INT_INT_INT. if people do that,
        couldn't they at least give it a non-standard name?

        * gtk/gtktextlayout.c: arg! yet another implementation of
        gtk_marshal_VOID__INT_INT_INT_INT(), is this a conspiracy?

        * gtk/gtktextbuffer.c: gotcha! captured a vagabonding
        gtk_marshal_VOID__INT_POINTER_INT() implementation, braught it back
        home. now i know this _is_ a conspiracy.

        * gtk/gtkwidget.c (gtk_widget_class_init): marshaller fixups for
        ::state-changed.

        * gtk/gtkaccelgroup.c (gtk_accel_group_create_remove):
        (gtk_accel_group_create_add): marshaller signature fixups.

        * gtk/gtklistitem.c (gtk_list_item_class_init): signal creation fixups,
        pass in GTK_TYPE_SCROLL_TYPE instead of GTK_TYPE_ENUM.

        * gtk/gtkobject.[hc]: removed GTK_CONNECTED flag, it's not valid
        anymore.

Tue Oct 24 23:59:21 2000  Tim Janik  <timj@gtk.org>

        * docs/reference/Makefile.am: disabled SUBDIRS for the moment, since
        due to the signal system changes, it wouldn't build currently. to
        be fixed soon.

        * docs/Changes-2.0.txt: GtkSignal/GSignal updates.

        * gtk/gtkwidget.c: ::direction_changed takes an enum as argument,
        so it needs gtk_marshal_VOID__ENUM() instead of
        gtk_marshal_NONE__UINT().

        * gdk/gdk*.c: adapted type registration functions.

        * gtk/gtkbindings.c:
        * gtk/gtkaccelgroup.c: operate on GSignalQuery, GtkSignalQuery is
        gone.

        * gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType.

        * gtk/gtkobject.c:
        (gtk_object_destroy):
        (gtk_object_shutdown): fixed recursion guards. basically we have to
        catch the case where any of GObject.shutdown() or gtk_object_destroy()
        is called during ::destroy, and avoid recursion there.

        * gtk/gtktypeutils.c:
        * gtk/maketypes.awk: awk-script hackup to provide gtk_type_init() with
        boxed_copy/boxed_free. this needs a more general solution based on a
        publically installed code-generator utility.

        * gtk/gtktypeutils.[hc]: compat aliased GTK_TYPE_BOXED to G_TYPE_BOXED,
        glib's gobject has support for that now.
        define GtkSignalMarshaller in terms of GSignalCMarshaller.


Mon Oct 23 09:36:42 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.[hc]:
        * gtk/gtkmarshal.[hc]:
        * gtk/Makefile.am: generate marshallers with glib-genmarshal and don't
        compile gtkmarshal.c on its own anymore, just include it in gtksignal.c.
        removed #include <gtkmarshal.h>s all over the place, gtksignal.h takes
        care of that.

        * *.c: marshaller name fixups.

        * gtk/gtkmarshal.list: added a comment briefing the format.

Sun Oct 22 23:14:39 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.[hc]: nuked old implementation. we mostly have
        compatibility macros here now. more specifically, most of
        the API is preserved (yes, _most_, nonwithstanding the
        following exceptions listed, the API is stil lHUGE ;)
        things that got removed completely:
        GtkSignalQuery, gtk_signal_query(), gtk_signal_n_emissions(),
        gtk_signal_n_emissions_by_name(), gtk_signal_handlers_destroy(),
        gtk_signal_set_funcs(), gtk_signal_handler_pending_by_id(),
        gtk_signal_add_emission_hook(), gtk_signal_add_emission_hook_full(),
        gtk_signal_remove_emission_hook().
        non-functional functions variants:
        gtk_signal_add_emission_hook(), gtk_signal_remove_emission_hook().
        the GtkCallbackMarshal argument to gtk_signal_connect_full() is
        not supported anymore.
        (gtk_signal_compat_matched): new internal function to aid
        implementation of the compatibility macros, it  provides
        functionality to block/unblock/disconnect handlers based
        on func/data.

        * gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType,

        * *.c: adaptions to new type registration API signatures.


Fri Oct 20 15:26:33 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtktypeutils.[hc]: removed G_TYPE_GTK_POINTER cludge.
2000-10-25 22:34:14 +00:00

295 lines
8.1 KiB
Plaintext

<!-- ##### SECTION Title ##### -->
Input Devices
<!-- ##### SECTION Short_Description ##### -->
Functions for handling extended input devices.
<!-- ##### SECTION Long_Description ##### -->
<para>
In addition to the normal keyboard and mouse input devices, GTK+ also
contains support for <firstterm>extended input devices</firstterm>. In
particular, this support is targeted at graphics tablets. Graphics
tablets typically return sub-pixel positioning information and possibly
information about the pressure and tilt of the stylus. Under
X, the support for extended devices is done through the
<firstterm>XInput</firstterm> extension.
</para>
<para>
Because handling extended input devices may involve considerable
overhead, they need to be turned on for each #GdkWindow
individually using gdk_input_set_extension_events().
(Or, more typically, for GtkWidgets, using gtk_widget_set_extension_events()).
As an additional complication, depending on the support from
the windowing system, its possible that a normal mouse
cursor will not be displayed for a particular extension
device. If an application does not want to deal with displaying
a cursor itself, it can ask only to get extension events
from devices that will display a cursor, by passing the
%GDK_EXTENSION_EVENTS_CURSOR value to
gdk_input_set_extension_events(). Otherwise, the application
must retrieve the device information using gdk_input_list_devices(),
check the <structfield>has_cursor</structfield> field, and,
if it is %FALSE, draw a cursor itself when it receives
motion events.
</para>
<para>
Each pointing device is assigned a unique integer ID; events from a
particular device can be identified by the
<structfield>deviceid</structfield> field in the event structure. The
events generated by pointer devices have also been extended to contain
<structfield>pressure</structfield>, <structfield>xtilt</structfield>
and <structfield>ytilt</structfield> fields which contain the extended
information reported as additional <firstterm>valuators</firstterm>
from the device. The <structfield>pressure</structfield> field is a
a double value ranging from 0.0 to 1.0, while the tilt fields are
double values ranging from -1.0 to 1.0. (With -1.0 representing the
maximum title to the left or up, and 1.0 representing the maximum
tilt to the right or down.)
</para>
<para>
One additional field in each event is the
<structfield>source</structfield> field, which contains an
enumeration value describing the type of device; this currently
can be one of
%GDK_SOURCE_MOUSE,
%GDK_SOURCE_PEN,
%GDK_SOURCE_ERASER,
or %GDK_SOURCE_CURSOR. This field is present to allow simple
applications to (for instance) delete when they detect eraser
devices without having to keep track of complicated per-device
settings.
</para>
<para>
Various aspects of each device may be configured. The easiest way of
creating a GUI to allow the user to conifigure such a device
is to use to use the #GtkInputDialog widget in GTK+.
However, even when using this widget, application writers
will need to directly query and set the configuration parameters
in order to save the state between invocations of the application.
The configuration of devices is queried using gdk_input_list_devices.
Each device must is activated using gdk_input_set_mode(), which
also controls whether the device's range is mapped to the
entire screen or to a single window. The mapping of the valuators of
the device onto the predefined valuator types is set using
gdk_input_set_axes. And the source type for each device
can be set with gdk_input_set_source().
</para>
<para>
Devices may also have associated <firstterm>keys</firstterm>
or macro buttons. Such keys can be globally set to map
into normal X keyboard events. The mapping is set using
gdk_input_set_key().
</para>
<para>
The interfaces in this section will most likely be considerably
modified in the future to accomodate devices that may have different
sets of additional valuators than the pressure xtilt and ytilt.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### STRUCT GdkDevice ##### -->
<para>
</para>
@name:
@source:
@mode:
@has_cursor:
@num_axes:
@axes:
@num_keys:
@keys:
<!-- ##### ENUM GdkInputSource ##### -->
<para>
An enumeration describing the type of an input device
in general terms.
</para>
@GDK_SOURCE_MOUSE: the device is a mouse. (This will be reported for the core
pointer, even if it is something else, such as a trackball.)
@GDK_SOURCE_PEN: the device is a stylus of a graphics tablet or similar device.
@GDK_SOURCE_ERASER: the device is an eraser. Typically, this would be the other end
of a stylus on a graphics tablet.
@GDK_SOURCE_CURSOR: the device is a graphics tablet "puck" or similar device.
<!-- ##### ENUM GdkInputMode ##### -->
<para>
An enumeration that describes the mode of an input device.
</para>
@GDK_MODE_DISABLED: the device is disabled and will not report any events.
@GDK_MODE_SCREEN: the device is enabled. The device's coordinate space
maps to the entire screen.
@GDK_MODE_WINDOW: the device is enabled. The device's coordinate space
is mapped to a single window. The manner in which this window
is chosen is undefined, but it will typically be the same
way in which the focus window for key events is determined.
<!-- ##### STRUCT GdkDeviceKey ##### -->
<para>
The #GdkDeviceKey structure contains information
about the mapping of one device macro button onto
a normal X key event. It has the following fields:
</para>
@keyval: the keyval to generate when the macro button is pressed.
If this is 0, no keypress will be generated.
@modifiers: the modifiers set for the generated key event.
<!-- ##### STRUCT GdkDeviceAxis ##### -->
<para>
</para>
@use:
@min:
@max:
<!-- ##### ENUM GdkAxisUse ##### -->
<para>
An enumeration describing the way in which a device
axis (valuator) maps onto the predefined valuator
types that GTK+ understands.
</para>
@GDK_AXIS_IGNORE: the axis is ignored.
@GDK_AXIS_X: the axis is used as the x axis.
@GDK_AXIS_Y: the axis is used as the y axis.
@GDK_AXIS_PRESSURE: the axis is used for pressure information.
@GDK_AXIS_XTILT: the axis is used for x tilt information.
@GDK_AXIS_YTILT: the axis is used for x tilt information.
@GDK_AXIS_WHEEL:
@GDK_AXIS_LAST: a constant equal to the numerically highest axis value.
<!-- ##### FUNCTION gdk_devices_list ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gdk_device_set_source ##### -->
<para>
</para>
@device:
@source:
<!-- ##### FUNCTION gdk_device_set_mode ##### -->
<para>
</para>
@device:
@mode:
@Returns:
<!-- ##### FUNCTION gdk_device_set_key ##### -->
<para>
</para>
@device:
@index:
@keyval:
@modifiers:
<!-- ##### FUNCTION gdk_device_set_axis_use ##### -->
<para>
</para>
@device:
@index:
@use:
<!-- ##### FUNCTION gdk_device_get_state ##### -->
<para>
</para>
@device:
@window:
@axes:
@mask:
<!-- ##### FUNCTION gdk_device_get_history ##### -->
<para>
</para>
@device:
@window:
@start:
@stop:
@events:
@n_events:
@Returns:
<!-- ##### FUNCTION gdk_device_free_history ##### -->
<para>
</para>
@events:
@n_events:
<!-- ##### STRUCT GdkTimeCoord ##### -->
<para>
The #GdkTimeCoord structure stores a single event in a
motion history. It contains the following fields:
</para>
@time: The timestamp for this event.
@axes:
<!-- ##### FUNCTION gdk_device_get_axis ##### -->
<para>
</para>
@device:
@axes:
@use:
@value:
@Returns:
<!-- ##### FUNCTION gdk_input_set_extension_events ##### -->
<para>
Turns extension events on or off for a particular window,
and specifies the event mask for extension events.
</para>
@window: a #GdkWindow.
@mask: the event mask
@mode: the type of extension events that are desired.
<!-- ##### ENUM GdkExtensionMode ##### -->
<para>
An enumeration used to specify which extension events
are desired for a particular widget.
</para>
@GDK_EXTENSION_EVENTS_NONE: no extension events are desired.
@GDK_EXTENSION_EVENTS_ALL: all extension events are desired.
@GDK_EXTENSION_EVENTS_CURSOR: extension events are desired only if a cursor
will be displayed for the device.