Exemple #1
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;

	}
}
Exemple #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;

	}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);
	}
}