diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2014-09-23 10:18:35 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2014-09-23 10:18:35 +0900 |
commit | 000f5fee84384423712cbb706d6da6aa2cd06007 (patch) | |
tree | 9e29623b6020296ebc696042ad56fd3d60da3c95 /src/lib/ecore_imf/ecore_imf_context.c | |
parent | 9d50d23e12d3abc0a7ed96708f023f2d06531418 (diff) |
ecore_imf: Add ecore_imf_context_bidi_direction_set/get API
Some Input Methods want to know the bidi direction (LTR/RTL) at the current cursor position.
Diffstat (limited to 'src/lib/ecore_imf/ecore_imf_context.c')
-rw-r--r-- | src/lib/ecore_imf/ecore_imf_context.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c index b301f3457e..b7142b19f4 100644 --- a/src/lib/ecore_imf/ecore_imf_context.c +++ b/src/lib/ecore_imf/ecore_imf_context.c | |||
@@ -167,6 +167,9 @@ ecore_imf_context_add(const char *id) | |||
167 | /* default input_mode is ECORE_IMF_INPUT_MODE_FULL, so let's make sure it's | 167 | /* default input_mode is ECORE_IMF_INPUT_MODE_FULL, so let's make sure it's |
168 | * set on the immodule */ | 168 | * set on the immodule */ |
169 | ecore_imf_context_input_mode_set(ctx, ECORE_IMF_INPUT_MODE_FULL); | 169 | ecore_imf_context_input_mode_set(ctx, ECORE_IMF_INPUT_MODE_FULL); |
170 | |||
171 | ecore_imf_context_bidi_direction_set(ctx, ECORE_IMF_BIDI_DIRECTION_NEUTRAL); | ||
172 | |||
170 | return ctx; | 173 | return ctx; |
171 | } | 174 | } |
172 | 175 | ||
@@ -1344,3 +1347,35 @@ ecore_imf_context_input_panel_show_on_demand_get(Ecore_IMF_Context *ctx) | |||
1344 | return ctx->input_panel_show_on_demand; | 1347 | return ctx->input_panel_show_on_demand; |
1345 | } | 1348 | } |
1346 | 1349 | ||
1350 | EAPI void | ||
1351 | ecore_imf_context_bidi_direction_set(Ecore_IMF_Context *ctx, Ecore_IMF_BiDi_Direction direction) | ||
1352 | { | ||
1353 | if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) | ||
1354 | { | ||
1355 | ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, | ||
1356 | "ecore_imf_context_bidi_direction_set"); | ||
1357 | return; | ||
1358 | } | ||
1359 | |||
1360 | if (ctx->bidi_direction != direction) | ||
1361 | { | ||
1362 | if (ctx->klass->bidi_direction_set) | ||
1363 | ctx->klass->bidi_direction_set(ctx, direction); | ||
1364 | |||
1365 | ctx->bidi_direction = direction; | ||
1366 | } | ||
1367 | } | ||
1368 | |||
1369 | EAPI Ecore_IMF_BiDi_Direction | ||
1370 | ecore_imf_context_bidi_direction_get(Ecore_IMF_Context *ctx) | ||
1371 | { | ||
1372 | if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) | ||
1373 | { | ||
1374 | ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, | ||
1375 | "ecore_imf_context_bidi_direction_get"); | ||
1376 | return ECORE_IMF_BIDI_DIRECTION_NEUTRAL; | ||
1377 | } | ||
1378 | |||
1379 | return ctx->bidi_direction; | ||
1380 | } | ||
1381 | |||