Back to index

im-sdk  12.3.91
Defines | Functions | Variables
common_aux_methods.c File Reference
#include <stdio.h>
#include <X11/Xmd.h>
#include <X11/Xlib.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include "xaux_common.h"
#include "xaux_ext_common.h"
#include "le_aux_protocol.h"
#include "common_aux_methods.h"

Go to the source code of this file.

Defines

#define ATOM_NUM_COMPOSITEAUX   32

Functions

GdkFilterReturn xaux_ext_event_handler (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer user_data)
int xaux_ext_register_classes (GdkWindow *window)
Bool xaux_ext_Start (xaux_class_t *xc, aux_ext_data_t *aux_ext_data, Atom atom)
Bool xaux_ext_Draw (xaux_class_t *xc, aux_ext_data_t *aux_ext_data, Atom atom)
Bool xaux_ext_Done (xaux_class_t *xc, aux_ext_data_t *aux_ext_data, Atom atom)
void composite_aux_Set_Selection_Owner ()
void composite_aux_get_cursor_rect (aux_ext_data_t *aux_ext_data, int *pos_x, int *pos_y, int *caret_w, int *caret_h)
void composite_aux_get_cursor_position (aux_ext_data_t *aux_ext_data, int *pos_x, int *pos_y)
void composite_aux_Connect_To_LE_Request (int locale_id)
 NotifyIntegerListDataToLanguageEngine (Display *display, int nIntegerCount, int *pIntegerList)
 NotifyStringListDataToLanguageEngine (Display *display, int nIntegerCount, int *pIntegerList, int nStringCount, int *pStringLen, char **pStringList)

Variables

xaux_class_txc_ = 0
int im_ = 0
int ic_ = 0
xaux_class_t xaux_class
int gLocaleID = 0
Display * gDisplay = NULL
Window gWindow = 0

Define Documentation

#define ATOM_NUM_COMPOSITEAUX   32

Definition at line 18 of file common_aux_methods.c.


Function Documentation

void composite_aux_Connect_To_LE_Request ( int  locale_id)

Definition at line 191 of file common_aux_methods.c.

{
    int nIntegerCount, pIntegerList[2];

    nIntegerCount = 2;
    pIntegerList[0] = SELECTAUX_CONNECT;
    pIntegerList[1] = locale_id;
    NotifyIntegerListDataToLanguageEngine(gDisplay, nIntegerCount,
                                          pIntegerList);
}

Here is the call graph for this function:

void composite_aux_get_cursor_position ( aux_ext_data_t aux_ext_data,
int *  pos_x,
int *  pos_y 
)

Definition at line 159 of file common_aux_methods.c.

{
    int win_x = 0, win_y = 0;

    Window w_none;
    Window clientwindow;
    XWindowAttributes attr;

    clientwindow = aux_ext_data->clientwin;
    if (clientwindow && gDisplay) {
        XGetWindowAttributes(gDisplay, clientwindow, &attr);
        if (attr.root)
            XTranslateCoordinates(gDisplay, clientwindow, attr.root, -(attr.border_width), -(attr.border_width), &win_x, &win_y, &w_none );
    }

    /*
    if ((win_x == 0 && win_y == 0) || (aux_ext_data->point.x == 0 && aux_ext_data->point.y == 0)) {
        win_x =  (gdk_screen_width () > 640)?200:100;
        win_y = (gdk_screen_height () - 200);
    } else {
    */
        win_x += aux_ext_data->point.x;
        win_y += aux_ext_data->point.y + 22;
    //}

    *pos_x = win_x;
    *pos_y = win_y;
}
void composite_aux_get_cursor_rect ( aux_ext_data_t aux_ext_data,
int *  pos_x,
int *  pos_y,
int *  caret_w,
int *  caret_h 
)

Definition at line 128 of file common_aux_methods.c.

{
    int win_x = 0, win_y = 0;

    Window w_none;
    Window clientwindow;
    XWindowAttributes attr;

    clientwindow = aux_ext_data->clientwin;
    if (clientwindow && gDisplay) {
        XGetWindowAttributes(gDisplay, clientwindow, &attr);
        if (attr.root)
            XTranslateCoordinates(gDisplay, clientwindow, attr.root, -(attr.border_width), -(attr.border_width), &win_x, &win_y, &w_none );
    }

    /*
    if ((win_x == 0 && win_y == 0) || (aux_ext_data->point.x == 0 && aux_ext_data->point.y == 0)) {
        win_x =  (gdk_screen_width () > 640)?200:100;
        win_y = (gdk_screen_height () - 200);
    } else {
    */
        win_x += aux_ext_data->point.x;
        win_y += aux_ext_data->point.y;
    //}

    *pos_x = win_x;
    *pos_y = win_y-20;
    *caret_w = 1;
    *caret_h = 25;
}

Definition at line 120 of file common_aux_methods.c.

{
    Atom aux_atom =
        XInternAtom(gDisplay, "CH_PROPERTIES_MODULE_ATOM", False);

    XSetSelectionOwner(gDisplay, aux_atom, gWindow, CurrentTime);
}
NotifyIntegerListDataToLanguageEngine ( Display *  display,
int  nIntegerCount,
int *  pIntegerList 
)

Definition at line 202 of file common_aux_methods.c.

{
    aux_ext_data_t aux_ext_data;

    aux_ext_data.im = im_;
    aux_ext_data.ic = ic_;
    aux_ext_data.integer_count = nIntegerCount;
    aux_ext_data.integer_list = pIntegerList;
    aux_ext_data.string_count = 0;
    aux_ext_data.string_list = NULL;
    aux_ext_data.string_ptr = NULL;
    aux_ext_data.point.x = 0;
    aux_ext_data.point.y = 0;

    xaux_ext_SetValue(display, xc_, &aux_ext_data);
    XFlush(display);
}

Here is the call graph for this function:

NotifyStringListDataToLanguageEngine ( Display *  display,
int  nIntegerCount,
int *  pIntegerList,
int  nStringCount,
int *  pStringLen,
char **  pStringList 
)

Definition at line 221 of file common_aux_methods.c.

{
    int i;

    aux_ext_data_t aux_ext_data;
    aux_ext_string_t *p;

    aux_ext_data.im = im_;
    aux_ext_data.ic = ic_;
    aux_ext_data.integer_count = nIntegerCount;
    aux_ext_data.integer_list = pIntegerList;
    aux_ext_data.point.x = 0;
    aux_ext_data.point.y = 0;

    aux_ext_data.string_count = nStringCount;
    aux_ext_data.string_ptr = NULL;

    if (nStringCount > 0) {
        aux_ext_data.string_list =
            (aux_ext_string_t *) calloc(nStringCount,
                                        sizeof(aux_ext_string_t));
        for (i = 0; i < nStringCount; i++) {
            aux_ext_string_t *p = &aux_ext_data.string_list[i];
            p->length = pStringLen[i];
            p->ptr = (unsigned char *) (pStringList[i]);
        }
    }

    xaux_ext_SetValue(display, xc_, &aux_ext_data);
    XFlush(display);

    free(aux_ext_data.string_list);
}

Here is the call graph for this function:

Bool xaux_ext_Done ( xaux_class_t xc,
aux_ext_data_t aux_ext_data,
Atom  atom 
)

Definition at line 112 of file common_aux_methods.c.

{
    DEBUG_printf("ext_Done im:0x%x, ic_id:0x%x\n", aux_ext_data->im,
                 aux_ext_data->ic);
    return True;
}
Bool xaux_ext_Draw ( xaux_class_t xc,
aux_ext_data_t aux_ext_data,
Atom  atom 
)

Definition at line 98 of file common_aux_methods.c.

{
    DEBUG_printf("ext_Draw == im:0x%x, ic:0x%x\n", aux_ext_data->im,
                 aux_ext_data->ic);
    im_ = aux_ext_data->im;
    ic_ = aux_ext_data->ic;
    xc_ = xc;

    composite_aux_Proc_LE_Notify(aux_ext_data);
    return True;
}

Here is the call graph for this function:

GdkFilterReturn xaux_ext_event_handler ( GdkXEvent *  gdk_xevent,
GdkEvent *  event,
gpointer  user_data 
)

Definition at line 39 of file common_aux_methods.c.

{
    XEvent *xevent = (XEvent *) gdk_xevent;

    switch (xevent->type) {
    case ClientMessage:
        xaux_ext_process_client_message((Display *) gDisplay,
                                        (XClientMessageEvent *) xevent);
        break;
    case SelectionClear:
        break;
    }
    return GDK_FILTER_CONTINUE;
}

Here is the call graph for this function:

int xaux_ext_register_classes ( GdkWindow *  window)

Definition at line 60 of file common_aux_methods.c.

{
    char *locale;

    gDisplay = (Display *) GDK_WINDOW_XDISPLAY(window);
    gWindow = (Window) GDK_WINDOW_XWINDOW(window);

    /* Register aux class */
    if (xaux_ext_init_classes(gDisplay, (xaux_class_t *) & xaux_class, gWindow) == False)
        return (False);

    return (True);
}

Here is the call graph for this function:

Bool xaux_ext_Start ( xaux_class_t xc,
aux_ext_data_t aux_ext_data,
Atom  atom 
)

Definition at line 83 of file common_aux_methods.c.

{
    DEBUG_printf("ext_Start: im:%d, ic:%d\n", aux_ext_data->im,
                 aux_ext_data->ic);
    im_ = aux_ext_data->im;
    ic_ = aux_ext_data->ic;
    xc_ = xc;

    /* inform Language Engine that PaletteAux has started. */

    return True;
}

Variable Documentation

Display* gDisplay = NULL

Definition at line 32 of file common_aux_methods.c.

int gLocaleID = 0

Definition at line 31 of file common_aux_methods.c.

Window gWindow = 0

Definition at line 33 of file common_aux_methods.c.

int ic_ = 0

Definition at line 16 of file common_aux_methods.c.

int im_ = 0

Definition at line 15 of file common_aux_methods.c.

Initial value:
 {
    COMPOSITE_AUX_CLASS_NAME, 1,
    NULL,
    (Window) 0, (Window) 0, (Window) 0,
    (Atom) 0, (Atom) 0, (Atom) 0, (Atom) 0,
    {(Atom) 0}, ATOM_NUM_COMPOSITEAUX, 0,
    {(Atom) 0}, ATOM_NUM_COMPOSITEAUX, 0,
    NULL,
}

Definition at line 21 of file common_aux_methods.c.

Definition at line 14 of file common_aux_methods.c.