diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-08-05 03:06:50 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-08-05 03:06:50 +0000 |
commit | 94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3 (patch) | |
tree | 317019f306f7195c07d3c0d943c829ed11ba8cca /ui/rccmenu.c | |
parent | 50aa5cd62ef4a66da41d68f4a50ddfca97863c38 (diff) | |
download | librcc-94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3.tar.gz librcc-94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3.tar.bz2 librcc-94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3.tar.xz librcc-94ca629ceec7b0dc9f6f724b2e15923d3ec1d5b3.zip |
Language AutoDetection Improvements
- Fix: Loading/Saving range options.
- Fix: Language AutoDetection. Using locale language instead of selected one.
- Support for range options in GTK UI.
- Option to control recoding timeout is provided.
- LibRCC.h is updated (Translate, Spell, IConv).
- Documentation is updated.
- Add 'rcc-config' alias to 'rcc-gtk2-config' in spec.
- Implemented concept of parrent languages
+ The concept is used in language autodetection. The string in considered
language is permited to have words from all it's parrent languages.
+ English is assumed to be parrent for all other languages by default.
+ Russian is parrent language for Ukrainian and Belorussian.
- No translation to english if translation between related (one of the
languages is parrent for another one) languages is failed.
Diffstat (limited to 'ui/rccmenu.c')
-rw-r--r-- | ui/rccmenu.c | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/ui/rccmenu.c b/ui/rccmenu.c index 5a51c56..0e87b08 100644 --- a/ui/rccmenu.c +++ b/ui/rccmenu.c @@ -51,6 +51,7 @@ rcc_ui_menu_context rccUiOptionMenuCreateContext(rcc_ui_menu_type type, rcc_opti ctx->ui_menu.type = type; ctx->id = id; ctx->type = otype; + ctx->realtype = otype; ctx->range = range; ctx->ui_menu.widget = rccUiMenuCreateWidget((rcc_ui_menu_context)ctx); @@ -68,23 +69,54 @@ void rccUiMenuFreeContext(rcc_ui_menu_context ctx) { rcc_class_id rccUiMenuGetClassId(rcc_ui_menu_context ctx) { - if (ctx->type != RCC_UI_MENU_CHARSET) return (rcc_class_id)-1; + if ((!ctx)||(ctx->type != RCC_UI_MENU_CHARSET)) return (rcc_class_id)-1; return ((rcc_ui_charset_menu_context)ctx)->id; } rcc_option rccUiMenuGetOption(rcc_ui_menu_context ctx) { - if (ctx->type != RCC_UI_MENU_OPTION) return (rcc_option)-1; + if ((!ctx)||(ctx->type != RCC_UI_MENU_OPTION)) return (rcc_option)-1; return ((rcc_ui_option_menu_context)ctx)->id; } rcc_option_type rccUiMenuGetType(rcc_ui_menu_context ctx) { - if (ctx->type != RCC_UI_MENU_OPTION) return (rcc_option_type)-1; + if ((!ctx)||(ctx->type != RCC_UI_MENU_OPTION)) return (rcc_option_type)-1; return ((rcc_ui_option_menu_context)ctx)->type; } +rcc_option_range *rccUiMenuGetRange(rcc_ui_menu_context ctx) { + if ((!ctx)||(ctx->type != RCC_UI_MENU_OPTION)) return NULL; + return ((rcc_ui_option_menu_context)ctx)->range; +} + rcc_option_range_type rccUiMenuGetRangeType(rcc_ui_menu_context ctx) { - if (ctx->type != RCC_UI_MENU_OPTION) return (rcc_option_type)-1; + if ((!ctx)||(ctx->type != RCC_UI_MENU_OPTION)) return (rcc_option_type)-1; return ((rcc_ui_option_menu_context)ctx)->range->type; } +int rccUiMenuHide(rcc_ui_menu_context ctx) { + if (!ctx) return -1; + + // Only options right now + if (ctx->type != RCC_UI_MENU_OPTION) return -1; + + ((rcc_ui_option_menu_context)ctx)->type = RCC_OPTION_TYPE_INVISIBLE; + + return 0; +} + +int rccUiMenuUnHide(rcc_ui_menu_context ctx) { + if (!ctx) return -1; + + // Only options right now + if (ctx->type != RCC_UI_MENU_OPTION) return -1; + + if (((rcc_ui_option_menu_context)ctx)->type == RCC_OPTION_TYPE_INVISIBLE) { + if (((rcc_ui_option_menu_context)ctx)->realtype == RCC_OPTION_TYPE_INVISIBLE) + ((rcc_ui_option_menu_context)ctx)->type = RCC_OPTION_TYPE_STANDARD; + else + ((rcc_ui_option_menu_context)ctx)->type = ((rcc_ui_option_menu_context)ctx)->realtype; + } + + return 0; +} |