On Thu, 28 Apr 2011, Enlightenment SVN wrote:
> Log: > From: Jihoon Kim <[email protected]> > Subject: [E-devel] [PATCH] Add ecore_imf_context_autocapital_type_{set, get}, > > To support the autocapitalization feature, I'd like to add > ecore_imf_context_autocapital_type_{set,get} API. > I will implement the autocapital feature in immodule, so the immodule > should know the autocapitalization type. > This API is for letting immodule know the autocapitalization type. > > In addition, ecore_imf_context_prediction_allow_set API is used to set > whether the IM context should allow to use the text prediction. > > > > Author: raster > Date: 2011-04-28 22:16:51 -0700 (Thu, 28 Apr 2011) > New Revision: 59025 > Trac: http://trac.enlightenment.org/e/changeset/59025 > > Modified: > trunk/ecore/ChangeLog trunk/ecore/src/lib/ecore_imf/Ecore_IMF.h > trunk/ecore/src/lib/ecore_imf/ecore_imf_context.c > trunk/ecore/src/lib/ecore_imf/ecore_imf_private.h > > Modified: trunk/ecore/ChangeLog > =================================================================== > --- trunk/ecore/ChangeLog 2011-04-28 20:57:30 UTC (rev 59024) > +++ trunk/ecore/ChangeLog 2011-04-29 05:16:51 UTC (rev 59025) > @@ -157,3 +157,8 @@ > monotonic clock through mach specific APIs that are perfectly suited > for usage in ecore_timer. > > +2011-04-20 Jihoon Kim > + > + * Ecore_IMF: Added support for auto-capitalization and prediction > + control API's > + and NEWS file ? Vincent > > Modified: trunk/ecore/src/lib/ecore_imf/Ecore_IMF.h > =================================================================== > --- trunk/ecore/src/lib/ecore_imf/Ecore_IMF.h 2011-04-28 20:57:30 UTC (rev > 59024) > +++ trunk/ecore/src/lib/ecore_imf/Ecore_IMF.h 2011-04-29 05:16:51 UTC (rev > 59025) > @@ -120,6 +120,14 @@ > ECORE_IMF_PREEDIT_TYPE_SUB3 > } Ecore_IMF_Preedit_Type; > > +typedef enum > +{ > + ECORE_IMF_AUTOCAPITAL_TYPE_NONE, > + ECORE_IMF_AUTOCAPITAL_TYPE_WORD, > + ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE, > + ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER > +} Ecore_IMF_Autocapital_Type; > + > struct _Ecore_IMF_Event_Preedit_Start > { > Ecore_IMF_Context *ctx; > @@ -295,6 +303,8 @@ > void (*input_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode > input_mode); > Eina_Bool (*filter_event) (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type > type, Ecore_IMF_Event *event); > void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char > **str, Eina_List **attrs, int *cursor_pos); > + void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool > prediction); > + void (*autocapital_type_set)(Ecore_IMF_Context *ctx, > Ecore_IMF_Autocapital_Type autocapital_type); > }; > > struct _Ecore_IMF_Context_Info > @@ -348,6 +358,10 @@ > EAPI void > ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx); > EAPI void > ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str); > EAPI void > ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int > offset, int n_chars); > +EAPI void > ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool > prediction); > +EAPI Eina_Bool > ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx); > +EAPI void > ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, > Ecore_IMF_Autocapital_Type autocapital_type); > +EAPI Ecore_IMF_Autocapital_Type > ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx); > > /* The following entry points must be exported by each input method module > */ > > Modified: trunk/ecore/src/lib/ecore_imf/ecore_imf_context.c > =================================================================== > --- trunk/ecore/src/lib/ecore_imf/ecore_imf_context.c 2011-04-28 20:57:30 UTC > (rev 59024) > +++ trunk/ecore/src/lib/ecore_imf/ecore_imf_context.c 2011-04-29 05:16:51 UTC > (rev 59025) > @@ -175,6 +175,15 @@ > /* default use_preedit is EINA_TRUE, so let's make sure it's > * set on the immodule */ > ecore_imf_context_use_preedit_set(ctx, EINA_TRUE); > + > + /* default prediction is EINA_TRUE, so let's make sure it's > + * set on the immodule */ > + ecore_imf_context_prediction_allow_set(ctx, EINA_TRUE); > + > + /* default autocapital type is SENTENCE type, so let's make sure it's > + * set on the immodule */ > + ecore_imf_context_autocapital_type_set(ctx, > ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE); > + > /* default input_mode is ECORE_IMF_INPUT_MODE_FULL, so let's make sure it's > * set on the immodule */ > ecore_imf_context_input_mode_set(ctx, ECORE_IMF_INPUT_MODE_FULL); > @@ -513,6 +522,96 @@ > } > > /** > + * Set whether the IM context should allow to use the text prediction. > + * If @prediction is EINA_FALSE (default is EINA_TRUE), then the IM context > will not display the text prediction window. > + * > + * @param ctx An #Ecore_IMF_Context. > + * @param prediction Whether the IM context should allow to use the text > prediction. > + * @ingroup Ecore_IMF_Context_Group > + * @since 1.1.0 > + */ > +EAPI void > +ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool > prediction) > +{ > + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) > + { > + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, > + "ecore_imf_context_prediction_allow_set"); > + return; > + } > + > + ctx->allow_prediction = prediction; > + > + if (ctx->klass->prediction_allow_set) > + ctx->klass->prediction_allow_set(ctx, prediction); > +} > + > +/** > + * Get whether the IM context should allow to use the text prediction. > + * > + * @param ctx An #Ecore_IMF_Context. > + * @return EINA_TRUE if it allows to use the text prediction, otherwise > EINA_FALSE. > + * @ingroup Ecore_IMF_Context_Group > + * @since 1.1.0 > + */ > +EAPI Eina_Bool > +ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx) > +{ > + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) > + { > + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, > + "ecore_imf_context_prediction_allow_get"); > + return EINA_FALSE; > + } > + > + return ctx->allow_prediction; > +} > + > +/** > + * Set the autocapitalization type on the immodule. > + * > + * @param ctx An #Ecore_IMF_Context. > + * @param autocapital_type the autocapitalization type. > + * @ingroup Ecore_IMF_Context_Group > + * @since 1.1.0 > + */ > +EAPI void > +ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, > Ecore_IMF_Autocapital_Type autocapital_type) > +{ > + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) > + { > + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, > + "ecore_imf_context_autocapital_type_set"); > + return; > + } > + > + ctx->autocapital_type = autocapital_type; > + > + if (ctx->klass->autocapital_type_set) > ctx->klass->autocapital_type_set(ctx, autocapital_type); > +} > + > +/** > + * Get the autocapitalization type. > + * > + * @param ctx An #Ecore_IMF_Context. > + * @return The autocapital type being used by @p ctx. > + * @ingroup Ecore_IMF_Context_Group > + * @since 1.1.0 > + */ > +EAPI Ecore_IMF_Autocapital_Type > +ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx) > +{ > + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) > + { > + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, > + "ecore_imf_context_autocapital_allow_get"); > + return ECORE_IMF_AUTOCAPITAL_TYPE_NONE; > + } > + > + return ctx->autocapital_type; > +} > + > +/** > * Set the callback to be used on get_surrounding request. > * > * This callback will be called when the Input Method Context > > Modified: trunk/ecore/src/lib/ecore_imf/ecore_imf_private.h > =================================================================== > --- trunk/ecore/src/lib/ecore_imf/ecore_imf_private.h 2011-04-28 20:57:30 UTC > (rev 59024) > +++ trunk/ecore/src/lib/ecore_imf/ecore_imf_private.h 2011-04-29 05:16:51 UTC > (rev 59025) > @@ -47,6 +47,8 @@ > void *client_canvas; > Eina_Bool (*retrieve_surrounding_func)(void *data, > Ecore_IMF_Context *ctx, char **text, int *cursor_pos); > void *retrieve_surrounding_data; > + Ecore_IMF_Autocapital_Type autocapital_type; > + Eina_Bool allow_prediction : 1; > }; > > struct _Ecore_IMF_Module > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > enlightenment-svn mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
