예제 #1
0
/* 注册一个输入法 */
LCUI_API int
LCUIIME_Register( const char *ime_name, LCUIIME_Func *ime_func )
{
	static int ime_id = 0; // 输入法的ID
	LCUIIME_Info *ptr_data;

	if( !imelist_init ) {
		return -1;
	}
	if( LCUIIME_FindByName( ime_name ) != NULL ) {
		return -2;
	}

	ptr_data = (LCUIIME_Info*)malloc( sizeof(LCUIIME_Info) );
	if( !ptr_data ) {
		return -3;
	}
	LCUIString_Init( &ptr_data->name );
	_LCUIString_Copy( &ptr_data->name, ime_name );
	ime_id = ime_id + 1;
	ptr_data->id = ime_id;
	memcpy( &ptr_data->func, ime_func, sizeof(LCUIIME_Func) );
	Queue_AddPointer( &imelist, ptr_data );
	return ime_id;
}
예제 #2
0
LCUI_API void
StyleClass_Init( LCUI_StyleClass *style_class )
{
	LCUIString_Init( &style_class->class_name );
	Queue_Init(	&style_class->style_attr,
			sizeof(LCUI_StyleAttr),
			NULL );
	Queue_Init(	&style_class->pseudo_classes, 
			sizeof(LCUI_StyleClass), 
			NULL );
}
예제 #3
0
LCUI_API void
StyleAttr_Init( LCUI_StyleAttr *attr )
{
	LCUIString_Init( &attr->attr_name );
	LCUIString_Init( &attr->attr_value );
}