GXimCore

GXimCore — Base class for XIM protocol event handling

Synopsis




                    GXimCore;
void                g_xim_core_watch_event              (GXimCore *core,
                                                         GdkWindow *window);
void                g_xim_core_unwatch_event            (GXimCore *core,
                                                         GdkWindow *window);
GdkDisplay*         g_xim_core_get_display              (GXimCore *core);
GdkWindow*          g_xim_core_get_selection_window     (GXimCore *core);
GType               g_xim_core_get_connection_gtype     (GXimCore *core);
GSList*             g_xim_core_get_protocol_signal_connector
                                                        (GXimCore *core);
void                g_xim_core_setup_connection         (GXimCore *core,
                                                         GXimConnection *conn);
void                g_xim_core_add_client_message_filter
                                                        (GXimCore *core,
                                                         GdkAtom atom);
void                g_xim_core_remove_client_message_filter
                                                        (GXimCore *core,
                                                         GdkAtom atom);
gboolean            g_xim_core_lookup_client_message_filter
                                                        (GXimCore *core,
                                                         GdkAtom atom);

Object Hierarchy


  GObject
   +----GXimCore
         +----GXimClientTemplate
         +----GXimServerTemplate

Properties


  "connection-gtype"         GType                 : Read / Write / Construct Only
  "display"                  GdkDisplay            : Read / Write / Construct Only
  "proto-signals"            gpointer              : Read / Write
  "selection-window"         GdkWindow             : Read

Signals


  "client-event"                                   : Run Last
  "destroy-event"                                  : Run Last
  "expose-event"                                   : Run Last
  "selection-clear-event"                          : Run Last
  "selection-notify-event"                         : Run Last
  "selection-request-event"                        : Run Last

Description

GXimCore provides a common functionality to deal with XIM protocol events for both server side and client side. You usually don't need to use most functions described here because any chance to do something with them is well hidden by the higher-level APIs, except if you want to make any classes that inherited from GXimCore or to do any particular thing with them.

Details

GXimCore

typedef struct _GXimCore GXimCore;

An abstract implementation of XIM protocol event handling class.


g_xim_core_watch_event ()

void                g_xim_core_watch_event              (GXimCore *core,
                                                         GdkWindow *window);

Adds the event filter to window and catches up events with core's event handler. This has to be done before starting the protocol negotiation. otherwise it will be lost and another application may be frozen in worst case.

core :

a GXimCore

window :

a GdkWindow that watches the event.

g_xim_core_unwatch_event ()

void                g_xim_core_unwatch_event            (GXimCore *core,
                                                         GdkWindow *window);

Removes the event filter from window and finishes watching events at core. This has to be done after finishing the protocol connection. otherwise some events will be lost and another application may be frozen in worst case.

core :

a GXimCore

window :

a GdkWindow that wants to remove from the watch list.

g_xim_core_get_display ()

GdkDisplay*         g_xim_core_get_display              (GXimCore *core);

Obtains the GdkDisplay that currently use.

core :

a GXimCore

Returns :

a display to use.

g_xim_core_get_selection_window ()

GdkWindow*          g_xim_core_get_selection_window     (GXimCore *core);

Obtains a selection window. this function may be necessary when you want to communicate the XIM server or clients through XIM protocol.

core :

a GXimCore

Returns :

"selection-window" in core.

g_xim_core_get_connection_gtype ()

GType               g_xim_core_get_connection_gtype     (GXimCore *core);

Obtains a GType of the class inherited from GXimConnection. This function is typically used to create an instance of the connection.

core :

a GXimCore

Returns :

"connection-gtype" in core.

g_xim_core_get_protocol_signal_connector ()

GSList*             g_xim_core_get_protocol_signal_connector
                                                        (GXimCore *core);

Obtains a list of the signal callbacks. This function is typically used to initialize the signal connectioon after creating an instance of the connection.

core :

a GXimCore

Returns :

a list of GXimLazySignalConnector.

g_xim_core_setup_connection ()

void                g_xim_core_setup_connection         (GXimCore *core,
                                                         GXimConnection *conn);

Initialize a conn's connection to get it working.

core :

a GXimCore

conn :

a GXimConnection to be initialized

g_xim_core_add_client_message_filter ()

void                g_xim_core_add_client_message_filter
                                                        (GXimCore *core,
                                                         GdkAtom atom);

Deals with the event when atom is specified as the message_type in "client-event".

core :

a GXimCore

atom :

a GdkAtom to deal with in the event filter.

g_xim_core_remove_client_message_filter ()

void                g_xim_core_remove_client_message_filter
                                                        (GXimCore *core,
                                                         GdkAtom atom);

Removes atom from the table and the event filter won't deals with it even when it's specified to the message_type in "client-event".

core :

a GXimCore

atom :

a GdkAtom to not deal with in the event filter any more.

g_xim_core_lookup_client_message_filter ()

gboolean            g_xim_core_lookup_client_message_filter
                                                        (GXimCore *core,
                                                         GdkAtom atom);

Looks up atom if it's registered to deal with it in "client-event".

core :

a GXimCore

atom :

a GdkAtom to look up

Returns :

TRUE if atom has already been added to the table.

Property Details

The "connection-gtype" property

  "connection-gtype"         GType                 : Read / Write / Construct Only

a GType inherited from GXimConnection. this will be a instance and determines the connection type when the connection is requested.


The "display" property

  "display"                  GdkDisplay            : Read / Write / Construct Only

Gdk display to use.


The "proto-signals" property

  "proto-signals"            gpointer              : Read / Write

a set of GXimLazySignalConnector to connect signals to a instance of "connection-gtype" when the connection is negothating.


The "selection-window" property

  "selection-window"         GdkWindow             : Read

a GdkWindow to communicate with the XIM server or the client application.

Signal Details

The "client-event" signal

gboolean            user_function                      (GXimCore       *core,
                                                        GdkEventClient *event,
                                                        gpointer        user_data)      : Run Last

The ::client-event signal will be emitted when the core's window receives a message (via ClientMessage event) from another application. all of XIM protocol is delivered with this signal.

core :

the object which received the signal.

event :

the GdkEventClient which triggered this signal.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.

The "destroy-event" signal

gboolean            user_function                      (GXimCore *core,
                                                        GdkEvent *event,
                                                        gpointer  user_data)      : Run Last

The ::destroy-event signal will be emitted when a GdkWindow is destroyed. typically you will see that when the client connection is disconnected from the client side.

core :

the object which received the signal.

event :

the GdkEvent which triggered this signal.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.

The "expose-event" signal

gboolean            user_function                      (GXimCore       *gximcore,
                                                        GdkEventExpose *event,
                                                        gpointer        user_data)      : Run Last


The "selection-clear-event" signal

gboolean            user_function                      (GXimCore          *core,
                                                        GdkEventSelection *event,
                                                        gpointer           user_data)      : Run Last

The ::selection-clear-event signal will be emitted when the core's window has lost ownership of a selection. this signal won't appears in the client instance, such as inherited from GXimClientTemplate.

core :

the object which received the signal.

event :

the GdkEventSelection which triggered this signal.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.

The "selection-notify-event" signal

gboolean            user_function                      (GXimCore          *core,
                                                        GdkEventSelection *event,
                                                        gpointer           user_data)      : Run Last

The ::selection-notify-event signal will be emitted when the the XIM server responded requests to get the supported locales and the transport-specific names. this signal won't appears in the server instance, such as inherited from GXimServerTemplate.

core :

the object which received the signal.

event :

the GdkEventSelection which triggered this signal.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.

The "selection-request-event" signal

gboolean            user_function                      (GXimCore          *core,
                                                        GdkEventSelection *event,
                                                        gpointer           user_data)      : Run Last

The ::selection-request-event signal will be emitted when the client applications requests a set of names of the supported locales and the preregistered formats for transport-specific names. this signal won't appears in the client instance, such as inherited from GXimClientTemplate.

core :

the object which received the signal.

event :

the GdkEventSelection which triggered this signal.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.