support repch - replacement char for passowrd mode. theme defines it now.

SVN revision: 37013
This commit is contained in:
Carsten Haitzler 2008-10-23 05:38:06 +00:00
parent 0621fd52cc
commit 48f89d316a
4 changed files with 49 additions and 1 deletions

View File

@ -144,6 +144,7 @@ static void st_collections_group_parts_part_description_text_text(void);
static void st_collections_group_parts_part_description_text_text_class(void);
static void st_collections_group_parts_part_description_text_font(void);
static void st_collections_group_parts_part_description_text_style(void);
static void st_collections_group_parts_part_description_text_repch(void);
static void st_collections_group_parts_part_description_text_size(void);
static void st_collections_group_parts_part_description_text_fit(void);
static void st_collections_group_parts_part_description_text_min(void);
@ -304,6 +305,7 @@ New_Statement_Handler statement_handlers[] =
{"collections.group.parts.part.description.text.text_class", st_collections_group_parts_part_description_text_text_class},
{"collections.group.parts.part.description.text.font", st_collections_group_parts_part_description_text_font},
{"collections.group.parts.part.description.text.style", st_collections_group_parts_part_description_text_style},
{"collections.group.parts.part.description.text.repch", st_collections_group_parts_part_description_text_repch},
{"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size},
{"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit},
{"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min},
@ -3838,6 +3840,44 @@ st_collections_group_parts_part_description_text_style(void)
ed->text.style = parse_str(0);
}
/**
@page edcref
@property
repch
@parameters
[the replacement character string]
@effect
If this is a textblock and is in PASSWORD mode this string is used
to replace every character to hide the details of the entry. Normally
you would use a "*", but you can use anything you like.
@endproperty
*/
static void
st_collections_group_parts_part_description_text_repch(void)
{
Edje_Part_Collection *pc;
Edje_Part *ep;
Edje_Part_Description *ed;
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
ep = eina_list_data_get(eina_list_last(pc->parts));
if (ep->type != EDJE_PART_TYPE_TEXTBLOCK)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXTBLOCK part.\n",
progname, file_in, line - 1);
exit(-1);
}
ed = ep->default_desc;
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
ed->text.repch = parse_str(0);
}
/**
@page edcref

View File

@ -327,6 +327,7 @@ _edje_edd_setup(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.text_class", text.text_class, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.style", text.style, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.font", text.font, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.repch", text.repch, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.size", text.size, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.fit_x", text.fit_x, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.fit_y", text.fit_y, EET_T_UCHAR);

View File

@ -1139,7 +1139,13 @@ _edje_entry_real_part_init(Edje_Real_Part *rp)
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOUSE_MOVE, _edje_part_mouse_move_cb, rp);
if (rp->part->entry_mode ==EDJE_ENTRY_EDIT_MODE_PASSWORD)
evas_object_textblock_replace_char_set(rp->object, "*");
{
if ((rp->chosen_description) &&
(rp->chosen_description->text.repch))
evas_object_textblock_replace_char_set(rp->object, rp->chosen_description->text.repch);
else
evas_object_textblock_replace_char_set(rp->object, "*");
}
en->cursor_bg = edje_object_add(rp->edje->evas);
edje_object_file_set(en->cursor_bg, rp->edje->path, rp->part->source3);

View File

@ -571,6 +571,7 @@ struct _Edje_Part_Description
char *text_class; /* how to apply/modify the font */
char *style; /* the text style if a textblock */
char *font; /* if a specific font is asked for */
char *repch; /* replacement char for password mode entry */
Edje_Alignment align; /* text alignment within bounds */