Back to index

im-sdk  12.3.91
Functions | Variables
composite_aux.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include "gtkiiimwin.h"

Go to the source code of this file.

Functions

GdkFilterReturn xaux_ext_event_handler (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer user_data)
static void pc_aux_option_change (TIIimPCWin vpc, int op)
static void pc_aux_candidate_selection (TIIimPCWin vpc, int idx)
static void pc_aux_candidate_page_request (TIIimPCWin vpc, int pgop)
static void pc_aux_move_notify (TIIimPCWin vpc, int op)
int main (int argc, char **argv)

Variables

void * composite_aux = NULL
static GtkWidget * mainwin = NULL
static const char * example_preedit = "<span color=\"darkblue\">在经过了yi duan shi jian de nu li zhi hou</span>"
static int example_caret = 37
static int example_candi_start = 4
static const char * example_candidates []

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 59 of file composite_aux.c.

{
    int style_id = 0;
    gtk_init (&argc, &argv);

    add_pixmap_directory (LE_PIXMAPS_DIR);
    add_pixmap_directory ("./pixmaps");

    mainwin = gtk_window_new(GTK_WINDOW_POPUP);
    gtk_widget_realize(mainwin);

    if (argc > 1)
        style_id = atoi(argv[1]);
    composite_aux = createStockPreeditCandidatesWindows(style_id);

    
    registerStyleChangeCallback(composite_aux, pc_aux_option_change);
    registerSelectionCallback(composite_aux, pc_aux_candidate_selection);
    registerPageCallback(composite_aux, pc_aux_candidate_page_request);
    registerMoveCallback(composite_aux, pc_aux_move_notify);

    if (argc > 1) {
        updatePreedit(composite_aux, example_preedit, example_caret, example_candi_start, 0, 0);
        updateCandidates(composite_aux, 6, example_candidates, "Sun拼音", 0, 0, 100, NULL, NULL);
        movePreedit(composite_aux, 300, 280, 12, 22);
        showCandidates(composite_aux);
        showPreedit(composite_aux);
    }


    gdk_window_add_filter(mainwin->window, xaux_ext_event_handler, 0);

    if (xaux_ext_register_classes(mainwin->window) == False) return (False);

    gtk_main();

//    printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++gtk_quiting....\n");
    gtk_widget_destroy(mainwin);
    freePreeditCandidatesWindows(composite_aux);

    return 0;
}

Here is the call graph for this function:

static void pc_aux_candidate_page_request ( TIIimPCWin  vpc,
int  pgop 
) [static]

Definition at line 34 of file composite_aux.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void pc_aux_candidate_selection ( TIIimPCWin  vpc,
int  idx 
) [static]

Definition at line 28 of file composite_aux.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void pc_aux_move_notify ( TIIimPCWin  vpc,
int  op 
) [static]

Definition at line 40 of file composite_aux.c.

{
    int cursor_x, cursor_y, cursor_w, cursor_h;
    getPCCursorPosition(vpc, &cursor_x, &cursor_y, &cursor_w, &cursor_h);
    composite_aux_send_move(cursor_x, cursor_y, cursor_w, cursor_h);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void pc_aux_option_change ( TIIimPCWin  vpc,
int  op 
) [static]

Definition at line 21 of file composite_aux.c.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 42 of file aux_manager_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;
}

Variable Documentation

Definition at line 17 of file composite_aux.c.

int example_candi_start = 4 [static]

Definition at line 49 of file composite_aux.c.

const char* example_candidates[] [static]
Initial value:
 {
    "<span color=\"darkgreen\">1.一段时间的努力之后</span>",
    "<span color=\"darkblue\">2.一段时间</span>",
    "3.一段",
    "4.一端",
    "5.异端",
    "6.臆断"
}

Definition at line 50 of file composite_aux.c.

int example_caret = 37 [static]

Definition at line 48 of file composite_aux.c.

const char* example_preedit = "<span color=\"darkblue\">在经过了yi duan shi jian de nu li zhi hou</span>" [static]

Definition at line 47 of file composite_aux.c.

GtkWidget* mainwin = NULL [static]

Definition at line 18 of file composite_aux.c.