Back to index

im-sdk  12.3.91
Functions | Variables
palette_aux.c File Reference
#include <stdio.h>
#include <glib.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <assert.h>
#include <koinput.h>
#include <signal.h>
#include <wait.h>
#include "pixmap.h"
#include "palette_aux.h"
#include "engine-property.h"
#include "kolelog.h"
#include "palette_messages.h"

Go to the source code of this file.

Functions

GdkFilterReturn xaux_ext_event_handler (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer user_data)
static GtkWidget * create_gtk_image_from_xpm (const char **xpm, int width, int height, gboolean force_create)
static void aux_palette_set_inputmode (INPUT_MODE_T i_imode)
static void aux_palette_setup_tooltips ()
void aux_palette_position_set (gint pos_x, gint pos_y)
static GdkPixbuf * scale_pixbuf (GdkPixbuf *pixbuf, int width, int height)
static void update_input_mode_button (KOLE_property *prop)
static void update_all_widgets (KOLE_property *prop)
static void aux_palette_redraw_self (gboolean visibility)
static gboolean aux_palette_click_event_handler (GtkWidget *window, GdkEventButton *event, gpointer user_data)
static void aux_palette_input_mode_popup_click_event_handler (gint i)
static void aux_palette_keyboard_popup_click_event_handler (gint i)
static void aux_palette_option_popup_click_event_handler (gint i)
static gint aux_palette_input_mode_button_click_event_handler (GtkWidget *widget, GdkEvent *event)
static gint aux_palette_keyboard_button_click_event_handler (GtkWidget *widget, GdkEvent *event)
static gint aux_palette_option_button_click_event_handler (GtkWidget *widget, GdkEvent *event)
static GtkWidget * create_popup_menu_from_list (const gchar **strs, void(*)(gint))
static void popup_positioner_keyboard (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer func_data)
static void palette_core_data_init (PaletteInfo pinfo)
static void palette_window_start_ime_about_dialog ()
void palette_window_show_vkb_window_with_layout (vkb_layout_t *)
static void palette_window_start_command (char *command_str)
int main (int argc, char **argv)
static void gtk_item_factory_menu_pos (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer func_data)
static void popup_positioner_option (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer func_data)
static gboolean ui_toolbar_window_motion_cb (GtkWidget *window, GdkEventMotion *event, gpointer user_data)
void paletteaux_update_display (KOLE_property *pep)
void paletteaux_change_visibility (gboolean visibility)
static GtkWidget * ui_create_punct_icon (gboolean full_width_punct_status)
static GtkWidget * ui_create_letter_icon (gboolean full_width_letter_status)
gboolean palette_window_init_vkb_window ()
void palette_window_toggle_vkb_window ()
static void palette_window_destroy_ime_about_dialog (GtkDialog *dialog, int response_id, gpointer data)
void palette_window_signal_child_handler (int sig, siginfo_t *info, void *ucontext)
void palette_window_register_signal_child_handler ()

Variables

KOLE_property * p_engine_property
PaletteInfoRecord palettecore
GdkColor _normal_bg
GdkColor _normal_text
GdkColor _active_bg
GdkColor _active_text
GtkTooltips * widget_tooltips = 0
gboolean _toolbar_window_draging = FALSE
gint _toolbar_window_drag_x = 0
gint _toolbar_window_drag_y = 0
gint _toolbar_window_pos_x = 0
gint _toolbar_window_pos_y = 0
gboolean _toolbar_window_show_status = FALSE
gboolean _full_width_punct_status = FALSE
gboolean _full_width_letter_status = FALSE
static const gchar * p_active_charsets []
static const gchar * p_keyboard_names []
static const gchar * p_option_names []

Function Documentation

static gboolean aux_palette_click_event_handler ( GtkWidget *  window,
GdkEventButton *  event,
gpointer  user_data 
) [static]

Definition at line 661 of file palette_aux.c.

{
    int click_type = GPOINTER_TO_INT (user_data);
    static gulong motion_handler;
    GdkCursor *cursor;
    if (click_type == 0 && event->button <= 1) {
       if (_toolbar_window_draging)
           return FALSE;
       // Connection pointer motion handler to this window.
       motion_handler =
           g_signal_connect (G_OBJECT (window), "motion-notify-event",
                           G_CALLBACK (ui_toolbar_window_motion_cb),
                           NULL);


       _toolbar_window_draging = TRUE;
       _toolbar_window_drag_x = (gint) event->x_root;
       _toolbar_window_drag_y = (gint) event->y_root;
       cursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW);

       // Grab the cursor to prevent losing events.
       gdk_pointer_grab (window->window, TRUE,
                       (GdkEventMask) (GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK),
                       NULL, cursor, event->time);
       gdk_cursor_unref (cursor);
       return TRUE;
    } else if (click_type == 1 && event->button <= 1) {
       if (!_toolbar_window_draging)
           return FALSE;
       g_signal_handler_disconnect (G_OBJECT (window), motion_handler);
       gdk_pointer_ungrab (event->time);
       _toolbar_window_draging = FALSE;

       return TRUE;
    } else if (click_type == 1 && event->button > 1) {
       return TRUE;
    }
    return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint aux_palette_input_mode_button_click_event_handler ( GtkWidget *  widget,
GdkEvent *  event 
) [static]

Definition at line 455 of file palette_aux.c.

{
    GtkWidget *pp;
    pp = palettecore.ppopup_input_mode; 
    if (pp == 0)
       return TRUE;

    if (event->type == GDK_BUTTON_PRESS) {
       GdkEventButton *bevent = (GdkEventButton *) event;

       KOLE_LOG (LOGDEST_STDOUT, "Input status button popup menu");
       gtk_menu_popup (GTK_MENU (pp), NULL, NULL, 
                     gtk_item_factory_menu_pos, bevent,
                     bevent->button, bevent->time);
       /* Tell calling code that we have handled this event; the buck
        * stops here. */
       return TRUE;
    }

    /* Tell calling code that we have not handled this event; pass it on. */
    return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void aux_palette_input_mode_popup_click_event_handler ( gint  i) [static]

Definition at line 480 of file palette_aux.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static gint aux_palette_keyboard_button_click_event_handler ( GtkWidget *  widget,
GdkEvent *  event 
) [static]

Definition at line 589 of file palette_aux.c.

{
    GdkEventButton *bev;
  
    if (palettecore.pbutton_keyboard == 0)
       return ;
  
    if (event->type == GDK_BUTTON_PRESS){
       bev = (GdkEventButton *) event;


       KOLE_LOG (LOGDEST_STDOUT, "Virtual Keyboard button popup menu");
       gtk_menu_popup (GTK_MENU (palettecore.ppopup_keyboard),
                     NULL, NULL,
                     popup_positioner_keyboard, bev,
                     bev->button, bev->time);
       return True;
    }
  
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void aux_palette_keyboard_popup_click_event_handler ( gint  i) [static]

Definition at line 493 of file palette_aux.c.

{
    KOLE_LOG (LOGDEST_STDOUT, "%s chosen", p_keyboard_names [i]);
/*   palette_window_toggle_vkb_window(); */
   if( i == 3 )
   {
          /*if close  keyboard, swithc keyboard layout to NO1 */
        /*paletteaux_send_show_keyboardaux_request(0); 

       palette_window_init_vkb_window();  
        palettecore.current_vkb_layout = palettecore.vkb_layout_list[0];*/
       if(palettecore.vkb_window)
              gtk_widget_hide(palettecore.vkb_window->window);

   }
   else
   {
      paletteaux_send_show_keyboardaux_request (i); 
      palette_window_init_vkb_window();
      palettecore.current_vkb_layout = palettecore.vkb_layout_list[i];
      palette_window_show_vkb_window_with_layout(palettecore.current_vkb_layout); 
   }

}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint aux_palette_option_button_click_event_handler ( GtkWidget *  widget,
GdkEvent *  event 
) [static]

Definition at line 612 of file palette_aux.c.

{
    GdkEventButton *bev;


    DEBUG_printf("aux_palette_option_button_click_event_handler() is called\n");
    if (palettecore.pbutton_option == 0)
        return ;

    if (event->type == GDK_BUTTON_PRESS){
        bev = (GdkEventButton *) event;

        KOLE_LOG (LOGDEST_STDOUT, "Option button popup menu");
        gtk_menu_popup (GTK_MENU (palettecore.ppopup_option),
                        NULL, NULL,
                        popup_positioner_option, bev,
                        bev->button, bev->time);
        return True;
    }

}

Here is the call graph for this function:

Here is the caller graph for this function:

static void aux_palette_option_popup_click_event_handler ( gint  i) [static]

Definition at line 521 of file palette_aux.c.

{
/*    paletteaux_send_show_keyboardaux_request (i); */
    char command_str[256];

    DEBUG_printf("menu item %d of option menu is pressed\n", i);
     if( i == 1)
     {
         if(palettecore.about_dialog == NULL)
                palette_window_start_ime_about_dialog();
         else
                gtk_widget_show(palettecore.about_dialog);
     }
    else if(i == 0)
    {
        snprintf(command_str, 256, "/usr/bin/mozilla %s/index.html", LE_DOCS_DIR);
        palette_window_start_command(command_str);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void aux_palette_position_set ( gint  pos_x,
gint  pos_y 
)

Definition at line 343 of file palette_aux.c.

{
    GtkRequisition ws;
    /*
     */
    gtk_widget_size_request (palettecore.ppalette, &ws);
    
     KOLE_LOG (LOGDEST_STDOUT, "testing: pos_x is %d, pos_y is %d, ws.width is %d, ws.height is %d\n",\
                      pos_x, pos_y, ws.width, ws.height);    
 
    if (pos_x + ws.width > gdk_screen_width ()) {
       pos_x = gdk_screen_width () - ws.width;
    } else if (pos_x < 0) {
       pos_x = 0;
    }
    if (pos_y + ws.height > gdk_screen_height ())
       pos_y = gdk_screen_height () - ws.height;
    else if (pos_y < 0)
       pos_y = 0;
    
    if (_toolbar_window_pos_x != pos_x || _toolbar_window_pos_y != pos_y) {
       gtk_window_move (GTK_WINDOW (palettecore.ppalette), pos_x, pos_y);
       _toolbar_window_pos_x = pos_x;
       _toolbar_window_pos_y = pos_y;
    }
    
      gtk_window_move (GTK_WINDOW (palettecore.ppalette), pos_x, pos_y);
    
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void aux_palette_redraw_self ( gboolean  visibility) [static]

Definition at line 754 of file palette_aux.c.

{
    if (visibility){
       gtk_widget_show_all (palettecore.ppalette);
    } else {
       gtk_widget_hide (palettecore.ppalette);
        if(palettecore.vkb_window)
            gtk_widget_hide(palettecore.vkb_window->window);
    }
}
static void aux_palette_set_inputmode ( INPUT_MODE_T  i_imode) [static]

Definition at line 742 of file palette_aux.c.

Here is the call graph for this function:

static void aux_palette_setup_tooltips ( ) [static]

Definition at line 722 of file palette_aux.c.

{

    palettecore.ptooltip = gtk_tooltips_new ();
    gtk_tooltips_set_delay (palettecore.ptooltip, 1000);
    gtk_tooltips_set_tip (palettecore.ptooltip,
                       palettecore.pbutton_input_mode,
                       _("다른 charset을 사용하도록 전환하려면 클릭하십시오"),
                       NULL);
    gtk_tooltips_set_tip (palettecore.ptooltip,
                       palettecore.pbutton_keyboard,
                       _("다른 키보드 배열을 사용하도록 전환하려면 클릭하십시오"),
                       NULL);
    gtk_tooltips_set_tip (palettecore.ptooltip,
                       palettecore.pbutton_option,
                       _("옵션 보조 창을 시작하려면 클릭하십시오"),
                       NULL);
}

Here is the caller graph for this function:

static GtkWidget * create_gtk_image_from_xpm ( const char **  xpm,
int  width,
int  height,
gboolean  force_create 
) [static]

Definition at line 305 of file palette_aux.c.

{
    GtkWidget *icon;
    GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);

    if (!pixbuf && !force_create)
       return 0;
  
    if (!pixbuf) {
       if (width <= 0 || height <= 0)
           return 0;
    
       pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
    
       if (!pixbuf)
           return 0;
    
       gdk_pixbuf_fill (pixbuf, 0);
    }

    if (width <= 0)
       width = gdk_pixbuf_get_width (pixbuf);
    if (height <= 0)
       height = gdk_pixbuf_get_height (pixbuf);

    pixbuf = scale_pixbuf (pixbuf, width, height);

    icon = gtk_image_new_from_pixbuf (pixbuf);
    gtk_widget_show (icon);

    gdk_pixbuf_unref (pixbuf);

    return icon;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static GtkWidget * create_popup_menu_from_list ( const gchar **  strs,
void(*)(gint)  popup_menu_handler 
) [static]

Definition at line 545 of file palette_aux.c.

{
    GtkWidget *menu;
    GtkWidget *menuitem;
    char **p;
    int i;

    menu = gtk_menu_new();

    for (p=strs, i = 0; *p; p++, i++) {
       menuitem = gtk_menu_item_new_with_label(*p);
       gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem);
       g_signal_connect_swapped(G_OBJECT(menuitem), "activate",
                             G_CALLBACK(popup_menu_handler), (gpointer )i);
       gtk_widget_show(menuitem);
    }

    gtk_widget_show(menu);

    return(menu);
}

Here is the caller graph for this function:

static void gtk_item_factory_menu_pos ( GtkMenu *  menu,
gint *  x,
gint *  y,
gboolean *  push_in,
gpointer  func_data 
) [static]

Definition at line 374 of file palette_aux.c.

{
    GdkEventButton *bevent = (GdkEventButton *)func_data;
    GtkRequisition size_menu, size_widget;
    gint menu_pos_x, menu_pos_y;

    gtk_widget_size_request ((GtkWidget *)menu, &size_menu);

    if (_toolbar_window_pos_y - size_menu.height > 0) {
       menu_pos_y = _toolbar_window_pos_y - size_menu.height;
    } else {
       gtk_widget_size_request ((GtkWidget *)palettecore.ppalette, &size_widget);
       menu_pos_y = _toolbar_window_pos_y + size_widget.height;
    }

    menu_pos_x = _toolbar_window_pos_x + palettecore.pbutton_input_mode->allocation.x;

    *x = menu_pos_x;
    *y = menu_pos_y;
}

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 130 of file palette_aux.c.

{
    PangoFontDescription *font_desc = 0;
    GtkWidget *menu;
    GtkWidget *hbox;
    GtkWidget *frame;
    GtkWidget *image;
    GtkRequisition size;
    GdkWindow *root_window;
 
    gint scr_width, scr_height;

    gtk_init (&argc, &argv);
  
    palette_core_data_init (&palettecore);
  
    // Read configurations.
    gdk_color_parse ("gray92",     &_normal_bg);
    gdk_color_parse ("black",      &_normal_text);
    gdk_color_parse ("light blue", &_active_bg);
    gdk_color_parse ("black",      &_active_text);

    palettecore.pdisplay = gdk_display_get_default ();
    palettecore.pscreen = gdk_display_get_default_screen (palettecore.pdisplay);
  
    font_desc = pango_font_description_from_string ("sans 10");
  
    /* Create toolbar window */
    palettecore.ppalette = gtk_window_new (GTK_WINDOW_POPUP);

    gtk_window_set_policy (GTK_WINDOW (palettecore.ppalette),
                        TRUE, TRUE, FALSE);

    gtk_window_set_resizable (GTK_WINDOW (palettecore.ppalette), FALSE);
    gtk_widget_add_events (palettecore.ppalette, GDK_BUTTON_PRESS_MASK);
    gtk_widget_add_events (palettecore.ppalette, GDK_BUTTON_RELEASE_MASK);
    gtk_widget_add_events (palettecore.ppalette, GDK_POINTER_MOTION_MASK);
    g_signal_connect (G_OBJECT (palettecore.ppalette),
                    "button-press-event",
                    G_CALLBACK (aux_palette_click_event_handler),
                    GINT_TO_POINTER (0));
    g_signal_connect (G_OBJECT (palettecore.ppalette),
                    "button-release-event",
                    G_CALLBACK (aux_palette_click_event_handler),
                    GINT_TO_POINTER (1));

    frame = gtk_frame_new (0);
    
    gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
    gtk_container_add (GTK_CONTAINER (palettecore.ppalette), frame);

    hbox = gtk_hbox_new (FALSE, 0);
    gtk_container_add (GTK_CONTAINER (frame), hbox);

    image = create_gtk_image_from_xpm ((const char **)move_xpm, 24, 20, 1);

    gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);

    palettecore.ppopup_input_mode =
       create_popup_menu_from_list (p_active_charsets, aux_palette_input_mode_popup_click_event_handler);

    palettecore.pbutton_input_mode = gtk_button_new ();
    gtk_widget_modify_font (GTK_BIN (palettecore.pbutton_input_mode)->child,
                         font_desc);
    gtk_button_set_relief (GTK_BUTTON (palettecore.pbutton_input_mode),
                        GTK_RELIEF_NONE);
    gtk_box_pack_start (GTK_BOX (hbox), palettecore.pbutton_input_mode,
                     TRUE, TRUE, 0);
    g_signal_connect_swapped (G_OBJECT (palettecore.pbutton_input_mode),
                           "button_press_event",
                           G_CALLBACK (aux_palette_input_mode_button_click_event_handler),
                           menu);

    /* New full_width_punctuation button */
    image = create_gtk_image_from_xpm ((const char **)keyboard_xpm, -1, -1, 1);
    gtk_widget_size_request (image, &size);
    /* Keyboard button */
    palettecore.pbutton_keyboard = gtk_button_new ();
    gtk_button_set_relief (GTK_BUTTON (palettecore.pbutton_keyboard),
                        GTK_RELIEF_NONE);
    gtk_container_add (GTK_CONTAINER (palettecore.pbutton_keyboard), image);
    
    gtk_widget_set_size_request (palettecore.pbutton_keyboard,
                             size.width + 4, size.height + 3);
    gtk_box_pack_start (GTK_BOX (hbox),
                     palettecore.pbutton_keyboard,
                     TRUE, TRUE, 0);

    g_signal_connect (G_OBJECT (palettecore.pbutton_keyboard),
                    "button_press_event",
                    G_CALLBACK (aux_palette_keyboard_button_click_event_handler),
                    0);


    /*  
       g_signal_connect_swapped (G_OBJECT (palettecore.pbutton_keyboard),
       "button_press_event",
       G_CALLBACK (aux_palette_keyboard_button_click_event_handler),
       menu);
    */
    
    palettecore.ppopup_keyboard =
       create_popup_menu_from_list (p_keyboard_names,
                                 aux_palette_keyboard_popup_click_event_handler);
   
    palettecore.ppopup_option = create_popup_menu_from_list(p_option_names, \
                            aux_palette_option_popup_click_event_handler); 

    /* New full_width_punctuation button */
    image = create_gtk_image_from_xpm ((const char **)options_xpm, -1, -1, 1);
    gtk_widget_size_request (image, &size);
    palettecore.pbutton_option = gtk_button_new ();
    gtk_button_set_relief (GTK_BUTTON (palettecore.pbutton_option),
                        GTK_RELIEF_NONE);
    gtk_container_add (GTK_CONTAINER (palettecore.pbutton_option), image);
    gtk_widget_set_size_request (palettecore.pbutton_option,
                             size.width + 4, size.height + 3);
    gtk_box_pack_start (GTK_BOX (hbox),
                     palettecore.pbutton_option,
                     TRUE, TRUE, 0);


     g_signal_connect (G_OBJECT (palettecore.pbutton_option),
                      "button_press_event",
                      G_CALLBACK (aux_palette_option_button_click_event_handler),
                      0); 

    gtk_widget_show_all (palettecore.ppalette);


    
    _toolbar_window_show_status = TRUE;

    gtk_widget_size_request (palettecore.ppalette, &size);
    aux_palette_position_set (gdk_screen_width () - size.width - 7*(gdk_screen_width()/8), 
                           gdk_screen_height () - size.height -gdk_screen_height()/8);
   
    _toolbar_window_drag_x =  gdk_screen_width () - size.width - 7*(gdk_screen_width()/8);
    _toolbar_window_drag_y =  gdk_screen_height () - size.height -gdk_screen_width()/8;

    gtk_widget_hide(palettecore.ppalette);


    gdk_window_add_filter(palettecore.ppalette->window,
                       xaux_ext_event_handler, 0);
    xaux_ext_register_classes(palettecore.ppalette->window);

    aux_palette_setup_tooltips ();

    root_window = gdk_screen_get_root_window (palettecore.pscreen);
    /*
    scr_width = gdk_screen_get_width (palettecore.pscreen);
    scr_height = gdk_screen_get_height (palettecore.pscreen);
    */
    gtk_window_get_size (GTK_WINDOW (root_window), &scr_width, &scr_height);
    gtk_window_get_size (GTK_WINDOW (palettecore.ppalette),
                      &palettecore.i_width,
                      &palettecore.i_height);

   /* aux_palette_position_set (scr_width - palettecore.i_width,
                           scr_height - palettecore.i_height);
    */
    palettecore.vkb_layout_list = NULL;
    palettecore.current_vkb_layout = NULL;
    palettecore.vkb_window = NULL;
    palettecore.vkb_show_status = 0;                          
    /*palette_window_init_vkb_window();*/
    
    gtk_main ();
    if (font_desc)
       pango_font_description_free (font_desc);
}

Here is the call graph for this function:

static void palette_core_data_init ( PaletteInfo  pinfo) [static]

Definition at line 783 of file palette_aux.c.

{
    assert (pinfo != NULL);
    pinfo->ppalette = NULL;
    pinfo->pbutton_input_mode = NULL;
    pinfo->ppopup_input_mode = NULL;
    pinfo->pbutton_keyboard = NULL;
    pinfo->pbutton_option = NULL;
    pinfo->ptooltip = NULL;
    pinfo->about_dialog = NULL;
    pinfo->i_width = pinfo->i_height = 0;
}

Here is the caller graph for this function:

static void palette_window_destroy_ime_about_dialog ( GtkDialog *  dialog,
int  response_id,
gpointer  data 
) [static]

Definition at line 950 of file palette_aux.c.

{
    gtk_widget_destroy ((GtkWidget *)dialog);
    
    palettecore.about_dialog = NULL;    
}

Here is the caller graph for this function:

Definition at line 890 of file palette_aux.c.

{
    char file_name[256];

    if (palettecore.vkb_window == NULL)
        palettecore.vkb_window = (vkb_window_t *)vkb_window_new();

    if (palettecore.vkb_window == NULL)
        return FALSE;

    if (palettecore.vkb_layout_list != NULL)
        return TRUE;

    sprintf(file_name, "%s%s", LE_AUX_MODULES_DIR, PALETTE_AUX_VKB_LAYOUT_FILE);

    palettecore.vkb_layout_list = (vkb_layout_t **)
        vkb_layout_list_read_from_layout_file(file_name);

    /*vkb_layout_list_print(palettecore.vkb_layout_list);*/

    if (palettecore.vkb_layout_list == NULL)
        return FALSE;

    palettecore.current_vkb_layout = palettecore.vkb_layout_list[0];
    return TRUE;
}

Here is the call graph for this function:

Definition at line 1032 of file palette_aux.c.

{
    struct sigaction act;

    act.sa_handler = NULL;
    act.sa_sigaction = palette_window_signal_child_handler;
    sigfillset(&act.sa_mask);
    act.sa_flags = SA_SIGINFO;

    sigaction(SIGCHLD, &act, NULL);
}

Here is the call graph for this function:

Definition at line 918 of file palette_aux.c.

Here is the call graph for this function:

void palette_window_signal_child_handler ( int  sig,
siginfo_t *  info,
void *  ucontext 
)

Definition at line 1021 of file palette_aux.c.

{
    pid_t pid;
    int status;

    while ((pid = waitpid(info->si_pid, &status, WNOHANG | WUNTRACED)) > 0) {
        printf("pid %d: die\n", pid);
    }
}
static void palette_window_start_command ( char *  command_str) [static]

Definition at line 1045 of file palette_aux.c.

{
    int pid;

    if (command_str == NULL)
        return;

    palette_window_register_signal_child_handler();

    pid = fork();
    if (pid < 0) {
        return;
    } else if (pid == 0) {
        /* in child process */
        execl("/bin/sh", "sh", "-c", command_str, (char *) 0);

        /* Exec failed. */
        fprintf(stderr, "Error: Could not exec %s!\n", command_str);
        _exit(1);
    }
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void palette_window_start_ime_about_dialog ( ) [static]

Definition at line 959 of file palette_aux.c.

{
    GtkWidget *dialog;
    GtkWidget *hbox;
    GtkWidget *vbox;
    GtkWidget *stock;
    GtkWidget *label;
    char message[2048];
    char title[256];


    DEBUG_printf ("about_dialog: \n");


    dialog = gtk_dialog_new_with_buttons ("정보",
                                     NULL,
                                     GTK_DIALOG_DESTROY_WITH_PARENT,
                                     GTK_STOCK_OK,
                                     GTK_RESPONSE_NONE,
                                     NULL);
    gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
    gtk_widget_show(dialog);

    hbox = gtk_hbox_new (FALSE, 8);
    gtk_widget_show(hbox);
    gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
    gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
  
    stock = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);
    gtk_widget_show(stock);
    gtk_box_pack_start (GTK_BOX (hbox), stock, FALSE, FALSE, 0);
  
    vbox = gtk_vbox_new (FALSE, 0);
    gtk_widget_show(vbox);
    gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 8);

    sprintf(message, "\n\n%s    %s%d.%02d\n\n%s\n%s\n\n%s\n%s\n\n", 
                    ABOUT_IME_SUFFIX,
                    ABOUT_IME_VERSION,
                    120/100,
                    120%100,
                    ABOUT_IME_AUTHOR,
                    "Karl.park@sun.com, Gavin.tu@sun.com, Ervin.yan@sun.com",
                    ABOUT_IME_COPYRIGHT,
                    "Copyright (c) 2004 Sun Microsystems");

    label = gtk_label_new (message);
    gtk_widget_show(label);
    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);

    g_signal_connect(dialog,
                   "response",
                   G_CALLBACK(palette_window_destroy_ime_about_dialog),
                   palettecore.ppalette);
    
    gtk_widget_show (dialog);
   palettecore.about_dialog = dialog;     
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 935 of file palette_aux.c.

{
    vkb_layout_t *vkb_layout = NULL;

    palette_window_init_vkb_window();

    if (palettecore.vkb_show_status == 0) {
        /* need draw the current vkb layout */
        vkb_layout = palettecore.current_vkb_layout;
    }

    palette_window_show_vkb_window_with_layout(vkb_layout);
}

Here is the call graph for this function:

void paletteaux_change_visibility ( gboolean  visibility)

Definition at line 803 of file palette_aux.c.

{
    if (visibility == FALSE){
       gtk_widget_hide (palettecore.ppalette);
       if(palettecore.vkb_window)
            gtk_widget_hide(palettecore.vkb_window->window);
    }  else {
       gtk_widget_show_all (palettecore.ppalette);
    }
}

Here is the caller graph for this function:

void paletteaux_update_display ( KOLE_property *  pep)

Definition at line 797 of file palette_aux.c.

{
    update_all_widgets (pep);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void popup_positioner_keyboard ( GtkMenu *  menu,
gint *  x,
gint *  y,
gboolean *  push_in,
gpointer  func_data 
) [static]

Definition at line 400 of file palette_aux.c.

{
    GdkEventButton *bevent = (GdkEventButton *)func_data;
    GtkRequisition size_menu, size_widget;
    gint menu_pos_x, menu_pos_y;

    gtk_widget_size_request ((GtkWidget *)menu, &size_menu);

    if (_toolbar_window_pos_y - size_menu.height > 0) {
       menu_pos_y = _toolbar_window_pos_y - size_menu.height;
    } else {
       gtk_widget_size_request ((GtkWidget *)palettecore.ppalette, &size_widget);
       menu_pos_y = _toolbar_window_pos_y + size_widget.height;
    }

    menu_pos_x = _toolbar_window_pos_x + palettecore.pbutton_input_mode->allocation.x;

    *x = menu_pos_x;
    *y = menu_pos_y;
}

Here is the caller graph for this function:

static void popup_positioner_option ( GtkMenu *  menu,
gint *  x,
gint *  y,
gboolean *  push_in,
gpointer  func_data 
) [static]

Definition at line 426 of file palette_aux.c.

{
    GdkEventButton *bevent = (GdkEventButton *)func_data;
    GtkRequisition size_menu, size_widget;
    gint menu_pos_x, menu_pos_y;

    gtk_widget_size_request ((GtkWidget *)menu, &size_menu);

    if (_toolbar_window_pos_y - size_menu.height > 0) {
        menu_pos_y = _toolbar_window_pos_y - size_menu.height;
    } else {
        gtk_widget_size_request ((GtkWidget *)palettecore.ppalette, &size_widget);
        menu_pos_y = _toolbar_window_pos_y + size_widget.height;
    }

    menu_pos_x = _toolbar_window_pos_x + palettecore.pbutton_input_mode->allocation.x +\
                             palettecore.pbutton_keyboard->allocation.x;

    *x = menu_pos_x;
    *y = menu_pos_y;
}

Here is the caller graph for this function:

static GdkPixbuf * scale_pixbuf ( GdkPixbuf *  pixbuf,
int  width,
int  height 
) [static]

Definition at line 706 of file palette_aux.c.

{
    if (pixbuf) {
       if (gdk_pixbuf_get_width (pixbuf) != width ||
           gdk_pixbuf_get_height (pixbuf) != height) {
           GdkPixbuf *dest =
              gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
           gdk_pixbuf_unref (pixbuf);
           pixbuf = dest;
        
       }
    }
    return pixbuf;
}

Here is the caller graph for this function:

static GtkWidget* ui_create_letter_icon ( gboolean  full_width_letter_status) [static]

Definition at line 830 of file palette_aux.c.

{
    GtkWidget *image;
    const char **xpm;

    if (full_width_letter_status == TRUE)
       xpm = (const char **)ch_punct_xpm;
    else
       xpm = (const char **)en_punct_xpm;

    image = create_gtk_image_from_xpm(xpm, -1, -1, 1);
    return(image);
}

Here is the call graph for this function:

static GtkWidget* ui_create_punct_icon ( gboolean  full_width_punct_status) [static]

Definition at line 815 of file palette_aux.c.

{
    GtkWidget *image;
    const char **xpm;

    if (full_width_punct_status == TRUE)
       xpm = (const char **)fullwidth_xpm;
    else
       xpm = (const char **)halfwidth_xpm;

    image = create_gtk_image_from_xpm(xpm, -1, -1, 1);
    return(image);
}

Here is the call graph for this function:

static gboolean ui_toolbar_window_motion_cb ( GtkWidget *  window,
GdkEventMotion *  event,
gpointer  user_data 
) [static]

Definition at line 638 of file palette_aux.c.

{
    gint pos_x, pos_y;
    guint state = GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK;
  
    if ((event->state & state) != 0 && _toolbar_window_draging) {
    
       gtk_window_get_position (GTK_WINDOW (window), &pos_x, &pos_y);
       aux_palette_position_set (
           pos_x + ((gint) event->x_root - _toolbar_window_drag_x),
           pos_y + ((gint) event->y_root - _toolbar_window_drag_y));

       _toolbar_window_drag_x = (gint) event->x_root;
       _toolbar_window_drag_y = (gint) event->y_root;
                                                                                                          
       return TRUE;
    }
    return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void update_all_widgets ( KOLE_property *  prop) [static]

Definition at line 766 of file palette_aux.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void update_input_mode_button ( KOLE_property *  prop) [static]

Definition at line 772 of file palette_aux.c.

{
    int i;
    /*assert (prop != NULL);*/
    if(prop == NULL)
       return;
    i = leproperty_get_charset (prop);
    gtk_button_set_label (GTK_BUTTON (palettecore.pbutton_input_mode), p_active_charsets[i]);
}

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

GdkColor _active_bg

Definition at line 47 of file palette_aux.c.

GdkColor _active_text

Definition at line 48 of file palette_aux.c.

Definition at line 65 of file palette_aux.c.

Definition at line 64 of file palette_aux.c.

GdkColor _normal_bg

Definition at line 45 of file palette_aux.c.

GdkColor _normal_text

Definition at line 46 of file palette_aux.c.

Definition at line 57 of file palette_aux.c.

Definition at line 58 of file palette_aux.c.

Definition at line 56 of file palette_aux.c.

Definition at line 60 of file palette_aux.c.

Definition at line 61 of file palette_aux.c.

Definition at line 63 of file palette_aux.c.

const gchar* p_active_charsets[] [static]
Initial value:
 {
    _("[Wansung]"),
    _("[Johap]"),
    NULL,
}

Definition at line 68 of file palette_aux.c.

KOLE_property* p_engine_property

Definition at line 62 of file palette_method.c.

const gchar* p_keyboard_names[] [static]
Initial value:
 {
    _("2벌식"),
    _("3벌식 390"),
    _("3벌식 최종"),  

    _("키보드 닫기"),  
    NULL,
}

Definition at line 75 of file palette_aux.c.

const gchar* p_option_names[] [static]
Initial value:
 {

    _("도움말"),
    _("정보"),
    NULL,
}

Definition at line 85 of file palette_aux.c.

Definition at line 43 of file palette_aux.c.

GtkTooltips* widget_tooltips = 0

Definition at line 54 of file palette_aux.c.