文档介绍:基于GTK的拼音输入法
http://hi・baidu. com/i love lei lei/blog/category/%C7%B6%C8%EB%CA%BD
基于GTK的拼音输入法(1)
2009-11-17 10:03
#include〈gtk/gtk. h>
#include〈stdio. h>
#include〈string. h>
#include〈ctype・ h>
#include 〈stdlib・h>
char T[] = {zzabcdefghi jklmnopqrstuvwxyz〃};
char TT[] = {〃ABCDEFGHIJKLMNOPQRSTUVWXYZ〃};
char pin_y[20];
char py_store[10];
char *CH_C0N[10][9];
char OPERATE; //操作标志位;
int SYMBOL = 0; 〃测试字数组的标志位,用来判断循环的
int ROW, COLUMN, R0W_MAX, COLUMN_MIN; 〃抽出字的数组的行列值 char ci_buffer[20] ; //预选存放字词的〜
char ci_py_buffer[20] ; //存放词的拼音;
char hanzi [60] ; //label 显示用的变量
char label_swap[30];
char entry_buffer[100];
GtkWidget *entry_all;
GtkWidget *label_py, *label_cn, *label_yx;
struct chinese_container
{
char label [2];
char py [8];
char ch [3];
struct Chinese_data
{
char data[4] ; //存放的一个字
int Frequency; //使用的频度
struct Chinese_data* next; // 指向下一个字
//struct Chinese_data* pre; //指向前一个字
};
struet word char data[20];
int Frequency;
struet word* next;
};
struet Element
{
char ElementType; // 元素的类型
struct Chinese_data *ch; //存放数据(汉子)
st rue t Eleme nt *Fa ther; //父指针 int 01d_new; //是新的还是旧的词 int I sword; //判断是字还是词 struct Element ^letter [26] ; //孩子指针 struct word *ci; //词的指针
};
struet struet struet struet struet
Element
Element
Element
Chinese
*pointer = NULL; *p_element 二 NULL; ^father = NULL;
data *pointer_ch = NULL; NULL;
Chinese_data *pu =
struet
word *pointer_ci, *pi;
函数名:creat_node_data; 输入参数:void; 输出:void;
功能:开辟汉字的存储空间;
struet Chinese_data
*creat_node_data(void)
struet Chinese_data *c;
(struet Chinese_data*)malloc(sizeof(struet Chinese_data)) return c;
}
函数名:creat node word: 输入参数:void; 输出:void;
功能:开辟词的存储空间,
struet word *creat_node_word(void) struet word *c;
c = (struet word*)malloc(sizeof(struet word));
return c;
}
函数名:creat_node;
输入参数:void;
输出:void;
功能:开辟链表的存储空间,
struet Element *creat_node(void) struet Element *b;
b = (struet Element *)malloc(sizeof(struet Element));
return b;
函数