E entry: Move to edje_entry and remove e_editable.

This should reduce the number of issues in the long run and reduced the
amount of code we have to maintain."

SVN revision: 78663
This commit is contained in:
Tom Hacohen 2012-10-30 14:06:13 +00:00
parent 25ee210ef8
commit a9bdc983b4
11 changed files with 335 additions and 2420 deletions

View File

@ -26135,9 +26135,10 @@ target: "region";
}
/* e/widgets/entry is used in the Wallpaper Picture file selector */
group {
name: "e/widgets/entry";
name: "e/widgets/entry/scrollframe";
// min: 12 12;
images.image: "inset_sunk.png" COMP;
parts {
part {
name: "base";
@ -26155,8 +26156,21 @@ target: "region";
}
}
part {
name: "e.swallow.text";
name: "clipper";
type: RECT;
description {
state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
}
}
part {
name: "e.swallow.content";
type: SWALLOW;
mouse_events: 1;
scale: 1;
clip_to: "clipper";
description {
state: "default" 0.0;
rel1 {
@ -26171,6 +26185,7 @@ target: "region";
}
part {
name: "overlay";
repeat_events: 1;
description {
state: "default" 0.0;
image {
@ -26207,34 +26222,54 @@ target: "region";
}
}
}
group {
name: "e/widgets/entry/text";
group { name: "e/widgets/entry/text";
styles {
style { name: "entry_textblock_style";
base: "font=Sans font_size=10 color=#000 text_class=entry color_classs=entry_text";
}
style { name: "entry_textblock_disabled_style";
base: "font=Sans font_size=10 color=#000 text_class=entry color_class=entry_text_disabled";
}
}
parts {
part {
name: "e.text.text";
type: TEXT;
mouse_events: 0;
type: TEXTBLOCK;
mouse_events: 1;
scale: 1;
entry_mode: EDITABLE;
select_mode: DEFAULT;
cursor_mode: BEFORE;
multiline: 0;
source: "e/widgets/entry/selection"; // selection under
source4: "e/widgets/entry/cursor"; // cursorover
description {
state: "default" 0.0;
color_class: "entry_text";
text {
text: "";
font: "Sans";
size: 10;
style: "entry_textblock_style";
min: 1 1;
align: 0.0 0.0;
text_class: "entry";
align: 0.0 0.5;
}
}
description {
state: "disabled" 0.0;
inherit: "default" 0.0;
text.style: "entry_textblock_disabled_style";
color_class: "entry_text_disabled";
}
}
}
programs {
program { name: "focus";
signal: "load";
source: "";
action: FOCUS_SET;
target: "e.text.text";
}
program {
name: "disable";
signal: "e,state,disabled";
@ -26251,6 +26286,19 @@ target: "region";
}
}
}
group { name: "e/widgets/entry/password";
inherit: "e/widgets/entry/text";
parts {
part { name: "e.text.text";
entry_mode: PASSWORD;
description { state: "default" 0.0;
text.repch: "*";
}
}
}
}
group {
name: "e/widgets/entry/cursor";
min: 1 0;
@ -26283,6 +26331,22 @@ target: "region";
target: "cursor_hide_timer";
after: "cursor_show";
}
program {
name: "on_cursor_hide";
signal: "e,action,hide,cursor";
source: "e";
action: ACTION_STOP;
target: "cursor_show";
target: "cursor_hide";
target: "cursor_show_timer";
target: "cursor_hide_timer";
after: "cursor_hide_stop";
}
program {
name: "cursor_hide_stop";
action: STATE_SET "default" 0.0;
target: "cursor";
}
program {
name: "cursor_show";
action: STATE_SET "visible" 0.0;

View File

@ -69,7 +69,6 @@ e_dialog.h \
e_dnd.h \
e_dpms.h \
e_eap_editor.h \
e_editable.h \
e_entry.h \
e_entry_dialog.h \
e_env.h \
@ -227,7 +226,6 @@ e_dialog.c \
e_dnd.c \
e_dpms.c \
e_eap_editor.c \
e_editable.c \
e_entry.c \
e_entry_dialog.c \
e_env.c \

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_EDITABLE_H
#define E_EDITABLE_H
EAPI Evas_Object *e_editable_add (Evas *evas);
EAPI void e_editable_theme_set (Evas_Object *editable, const char *category, const char *group);
EAPI void e_editable_password_set (Evas_Object *editable, int password_mode);
EAPI int e_editable_password_get (Evas_Object *editable);
EAPI void e_editable_text_set (Evas_Object *editable, const char *text);
EAPI const char *e_editable_text_get (Evas_Object *editable);
EAPI char *e_editable_text_range_get (Evas_Object *editable, int start, int end);
EAPI int e_editable_text_length_get (Evas_Object *editable);
EAPI int e_editable_insert (Evas_Object *editable, int pos, const char *text);
EAPI int e_editable_delete (Evas_Object *editable, int start, int end);
EAPI void e_editable_cursor_pos_set (Evas_Object *editable, int pos);
EAPI int e_editable_cursor_pos_get (Evas_Object *editable);
EAPI void e_editable_cursor_geometry_get (Evas_Object *editable, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);
EAPI void e_editable_cursor_move_to_start (Evas_Object *editable);
EAPI void e_editable_cursor_move_to_end (Evas_Object *editable);
EAPI void e_editable_cursor_move_left (Evas_Object *editable);
EAPI void e_editable_cursor_move_right (Evas_Object *editable);
EAPI void e_editable_cursor_show (Evas_Object *editable);
EAPI void e_editable_cursor_hide (Evas_Object *editable);
EAPI void e_editable_selection_pos_set (Evas_Object *editable, int pos);
EAPI int e_editable_selection_pos_get (Evas_Object *editable);
EAPI void e_editable_selection_move_to_start (Evas_Object *editable);
EAPI void e_editable_selection_move_to_end (Evas_Object *editable);
EAPI void e_editable_selection_move_left (Evas_Object *editable);
EAPI void e_editable_selection_move_right (Evas_Object *editable);
EAPI void e_editable_select_all (Evas_Object *editable);
EAPI void e_editable_unselect_all (Evas_Object *editable);
EAPI void e_editable_select_word (Evas_Object *editable, int index);
EAPI void e_editable_selection_show (Evas_Object *editable);
EAPI void e_editable_selection_hide (Evas_Object *editable);
EAPI int e_editable_pos_get_from_coords (Evas_Object *editable, Evas_Coord x, Evas_Coord y);
EAPI void e_editable_char_size_get (Evas_Object *editable, int *w, int *h);
EAPI void e_editable_enable (Evas_Object *entry);
EAPI void e_editable_disable (Evas_Object *entry);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ EAPI Evas_Object *e_entry_add (Evas *evas);
EAPI void e_entry_text_set (Evas_Object *entry, const char *text);
EAPI const char *e_entry_text_get (Evas_Object *entry);
EAPI void e_entry_clear (Evas_Object *entry);
EAPI Evas_Object *e_entry_editable_object_get (Evas_Object *entry);
EAPI void e_entry_select_all (Evas_Object *entry);
EAPI void e_entry_password_set (Evas_Object *entry, int password_mode);
EAPI void e_entry_size_min_get (Evas_Object *entry, Evas_Coord *minw, Evas_Coord *minh);

View File

@ -66,7 +66,7 @@ e_entry_dialog_show(const char *title, const char *icon, const char *text,
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
e_widget_focus_set(ed->entry, 1);
e_editable_select_all(e_widget_entry_editable_object_get(ed->entry));
e_widget_entry_select_all(ed->entry);
return ed;
}

View File

@ -9760,7 +9760,6 @@ _e_fm2_file_rename(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
static Evas_Object *
_e_fm2_icon_entry_widget_add(E_Fm2_Icon *ic)
{
Evas_Object *eo;
Evas *e;
E_Container *con;
E_Manager *man;
@ -9789,9 +9788,7 @@ _e_fm2_icon_entry_widget_add(E_Fm2_Icon *ic)
evas_object_show(ic->entry_widget);
e_widget_entry_text_set(ic->entry_widget, ic->info.file);
e_widget_focus_set(ic->entry_widget, 0);
eo = e_widget_entry_editable_object_get(ic->entry_widget);
e_editable_cursor_move_to_start(eo);
e_editable_selection_move_to_end(eo);
e_widget_entry_select_all(ic->entry_widget);
ic->sd->iop_icon = ic;
ic->sd->typebuf.disabled = EINA_TRUE;

View File

@ -16,7 +16,6 @@
#include "e_icon.h"
#include "e_box.h"
#include "e_flowlayout.h"
#include "e_editable.h"
#include "e_entry.h"
#include "e_init.h"
#include "e_int_menus.h"

View File

@ -161,21 +161,18 @@ e_widget_entry_readonly_set(Evas_Object *entry, int readonly_mode)
}
/**
* Gets the editable object of the entry widget. It will allow you to have
* better control on the text, the cursor or the selection of the entry with
* the e_editable_*() functions.
* Selects the content of the entry.
*
* @param entry an entry widget
* @return Returns the editable object of the entry widget
*/
EAPI Evas_Object *
e_widget_entry_editable_object_get(Evas_Object *entry)
EAPI void
e_widget_entry_select_all(Evas_Object *entry)
{
E_Widget_Data *wd;
if (!(entry) || (!(wd = e_widget_data_get(entry))))
return NULL;
return e_entry_editable_object_get(wd->o_entry);
return;
e_entry_select_all(wd->o_entry);
}

View File

@ -9,7 +9,7 @@ EAPI const char *e_widget_entry_text_get (Evas_Object *entry);
EAPI void e_widget_entry_clear (Evas_Object *entry);
EAPI void e_widget_entry_password_set (Evas_Object *entry, int password_mode);
EAPI void e_widget_entry_readonly_set (Evas_Object *entry, int readonly_mode);
EAPI Evas_Object *e_widget_entry_editable_object_get (Evas_Object *entry);
EAPI void e_widget_entry_select_all (Evas_Object *entry);
#endif
#endif