Beispiel #1
0
static void ibus_handwrite_engine_init(IBusHandwriteEngine *handwrite)
{
//	puts(__func__);
	G_TYPE_IBUS_HANDWRITE_RECOG_ZINNIA;
	G_TYPE_IBUS_HANDWRITE_RECOG_LUCYKILA;
	//先注册2个引擎
	handwrite->engine_type = G_TYPE_IBUS_HANDWRITE_RECOG_LUCYKILA ;

#ifdef WITH_ZINNIA
	if( strcmp(lang,"jp") ==0 || strcmp(lang,"ja")==0 )
	{
		handwrite->engine_type = G_TYPE_IBUS_HANDWRITE_RECOG_ZINNIA;
	}
#endif

	handwrite->engine = ibus_handwrite_recog_new(handwrite->engine_type);
	handwrite->engine->engine = handwrite;
}
Beispiel #2
0
void ibus_handwrite_property_activate(IBusEngine *engine,const gchar *prop_name, guint prop_state)
{
	IBusHandwriteEngine *  handwrite = IBUS_HANDWRITE_ENGINE(engine);

	if(g_strcmp0(prop_name,"choose-engine")==0)
	{
		g_debug("change engine");

		g_object_unref(handwrite->engine);

		if (handwrite->engine_type == G_TYPE_IBUS_HANDWRITE_RECOG_ZINNIA)
			handwrite->engine_type = G_TYPE_IBUS_HANDWRITE_RECOG_LUCYKILA;
		else
			handwrite->engine_type = G_TYPE_IBUS_HANDWRITE_RECOG_ZINNIA;

		handwrite->engine = ibus_handwrite_recog_new(handwrite->engine_type);
		handwrite->engine->engine = handwrite;

	}
}
Beispiel #3
0
void ibus_handwrite_property_activate(IBusEngine *engine,const gchar *prop_name, guint prop_state)
{
	IBusHandwriteEngine *  handwrite = IBUS_HANDWRITE_ENGINE(engine);

	if(g_strcmp0(prop_name,"choose-engine")==0)
	{
		g_debug("change engine");

		g_object_unref(handwrite->engine);

		if (handwrite->engine_type == G_TYPE_IBUS_HANDWRITE_RECOG_ZINNIA)
			handwrite->engine_type = G_TYPE_IBUS_HANDWRITE_RECOG_LUCYKILA;
		else
			handwrite->engine_type = G_TYPE_IBUS_HANDWRITE_RECOG_ZINNIA;

		handwrite->engine = ibus_handwrite_recog_new(handwrite->engine_type);
		handwrite->engine->engine = handwrite;

	}else if(g_strcmp0(prop_name,"choose-color")==0)
	{
		g_debug("color choose");

		GtkWidget * dialog = gtk_color_selection_dialog_new(prop_name);


		GtkWidget * color_sel = gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dialog));

		gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(color_sel),handwrite->color);

		gtk_dialog_run(GTK_DIALOG(dialog));

		gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(color_sel),handwrite->color);

		gtk_widget_destroy(dialog);
	}
}