Back to index

im-sdk  12.3.91
Enumerations | Functions
unicode_block.c File Reference
#include <gtk/gtk.h>
#include "unicode_block.h"

Go to the source code of this file.

Enumerations

enum  { COLUMN_BLOCK_NAME, COLUMN_BLOCK_BEGIN, COLUMN_BLOCK_END, COLUMN_COUNT }

Functions

static void unicodelookup_init (UnicodeLookup *obj)
static GtkWidget * make_unicode_block_selector ()
static GtkWidget * make_unicode_chartable ()
static void unicode_block_changed (GtkTreeSelection *, gpointer)
static void set_active_char_event_handler (GtkWidget *, gunichar, UnicodeLookup *)
GType unicodelookup_get_type (void)
static GtkWidget * make_unicode_block_selector (UnicodeLookup *obj)
GtkWidget * unicodelookup_new (void)

Enumeration Type Documentation

anonymous enum
Enumerator:
COLUMN_BLOCK_NAME 
COLUMN_BLOCK_BEGIN 
COLUMN_BLOCK_END 
COLUMN_COUNT 

Definition at line 29 of file unicode_block.c.


Function Documentation

static GtkWidget* make_unicode_block_selector ( ) [static]

Here is the caller graph for this function:

static GtkWidget* make_unicode_block_selector ( UnicodeLookup *  obj) [static]

Definition at line 84 of file unicode_block.c.

{
  GtkWidget *tv;
  GtkTreeStore *tv_model;
  GtkTreeIter iter;
  GtkCellRenderer *cell;
  GtkTreeViewColumn *column;
  
  tv_model = gtk_tree_store_new (
                             COLUMN_COUNT, G_TYPE_STRING,
                             G_TYPE_UINT, G_TYPE_UINT);
  gtk_tree_store_append (tv_model, &iter, NULL);
  gtk_tree_store_set (tv_model, &iter,
                    COLUMN_BLOCK_NAME, "--ga--",
                    COLUMN_BLOCK_BEGIN, 0xac00,
                    COLUMN_BLOCK_END, 0xb097, -1);
  gtk_tree_store_append (tv_model, &iter, NULL);
  gtk_tree_store_set (tv_model, &iter,
                      COLUMN_BLOCK_NAME, "--na--",
                      COLUMN_BLOCK_BEGIN, 0xb098,
                      COLUMN_BLOCK_END, 0xb2e3, -1);
  tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (tv_model));
  obj->tree_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
  cell = gtk_cell_renderer_text_new ();
  column =
    gtk_tree_view_column_new_with_attributes (NULL, cell,
                                         "text", COLUMN_BLOCK_NAME, NULL);
  gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
  gtk_widget_show_all (tv);

  obj->block_selection_changed_handler_id =
    g_signal_connect (
             G_OBJECT (obj->tree_selection), "changed",
                    G_CALLBACK (unicode_block_changed), obj);

       
  return tv;
}

Here is the call graph for this function:

static GtkWidget * make_unicode_chartable ( ) [static]

Definition at line 133 of file unicode_block.c.

{
  GtkWidget *char_table;
  
  char_table = unicharinfo_new ();
  gtk_widget_show (char_table);

  return char_table;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_active_char_event_handler ( GtkWidget *  widget,
gunichar  uc,
UnicodeLookup *  obj 
) [static]

Definition at line 124 of file unicode_block.c.

{
  g_print ("set_active_char_event_handler called\n");
}

Here is the caller graph for this function:

static void unicode_block_changed ( GtkTreeSelection *  selection,
gpointer  data 
) [static]

Definition at line 150 of file unicode_block.c.

{
  GtkTreeModel *model;
  GtkTreeIter iter;
  gchar *buffer;
  gint i_page;
  GtkWidget *page;
  UnicodeLookup *obj = UNICODELOOKUP(data);
  
  if (gtk_tree_selection_get_selected (selection, &model, &iter)){
    gtk_tree_model_get (model, &iter, COLUMN_BLOCK_NAME, &buffer, -1);

    g_printf (buffer);
  }
}

Here is the caller graph for this function:

GType unicodelookup_get_type ( void  )

Definition at line 42 of file unicode_block.c.

{
  static GType unicodelookup_type = 0;
  if (!unicodelookup_type){
    static const GTypeInfo unicodelookup_info = {
      sizeof (UnicodeLookupClass),
      NULL, /* base init */
      NULL, /* base finalize */
      (GClassInitFunc) NULL, /* class init */
      NULL, /* class finalize */
      NULL, /* class data */
      sizeof (UnicodeLookup),
      0,
      (GInstanceInitFunc) unicodelookup_init, /* obj init */
      NULL /* value table */
    };
    unicodelookup_type =
      g_type_register_static (GTK_TYPE_HPANED, "unicodelookup",
                           &unicodelookup_info, 0);
  }
  return unicodelookup_type;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void unicodelookup_init ( UnicodeLookup *  obj) [static]

Definition at line 66 of file unicode_block.c.

{
  obj->block_selector = make_unicode_block_selector (obj);
  obj->char_table =  make_unicode_chartable ();

  g_signal_connect (G_OBJECT (obj->char_table),
                  "set_active_char",
                  G_CALLBACK (set_active_char_event_handler), obj);

  gtk_paned_pack1 (GTK_PANED (obj), obj->block_selector, FALSE, TRUE);
  gtk_paned_pack2 (GTK_PANED (obj), obj->char_table, TRUE, TRUE);
  
  gtk_widget_show (obj->block_selector);
  gtk_widget_show (obj->char_table);
}

Here is the call graph for this function:

Here is the caller graph for this function:

GtkWidget* unicodelookup_new ( void  )

Definition at line 144 of file unicode_block.c.

{
  return GTK_WIDGET (g_object_new (unicodelookup_get_type (), NULL));
}

Here is the call graph for this function: