start a desktop entry mode. shift arrows start/mod selection. can just
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 1 Apr 2011 13:20:40 +0000 (13:20 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 1 Apr 2011 13:20:40 +0000 (13:20 +0000)
click and drag to select.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@58258 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

config/default/base.src
config/illume/base.src
config/standard/base.src
src/lib/elm_config.c
src/lib/elm_entry.c
src/lib/elm_priv.h

index 2d64f64..1c94485 100644 (file)
@@ -35,4 +35,5 @@ group "Elm_Config" struct {
   value "icon_size" int: 32;
   value "longpress_timeout" double: 1.0;
   value "effect_enable" uchar: 1;
+  value "desktop_entry" uchar: 0;
 }
index 2d64f64..1c94485 100644 (file)
@@ -35,4 +35,5 @@ group "Elm_Config" struct {
   value "icon_size" int: 32;
   value "longpress_timeout" double: 1.0;
   value "effect_enable" uchar: 1;
+  value "desktop_entry" uchar: 0;
 }
index 359266b..0c7d1c7 100644 (file)
@@ -35,4 +35,5 @@ group "Elm_Config" struct {
   value "icon_size" int: 32;
   value "longpress_timeout" double: 1.0;
   value "effect_enable" uchar: 1;
+  value "desktop_entry" uchar: 1;
 }
index 4490fab..3cd302f 100644 (file)
@@ -599,6 +599,7 @@ _desc_init(void)
    ELM_CONFIG_VAL(D, T, icon_size, T_INT);
    ELM_CONFIG_VAL(D, T, longpress_timeout, T_DOUBLE);
    ELM_CONFIG_VAL(D, T, effect_enable, T_UCHAR);
+   ELM_CONFIG_VAL(D, T, desktop_entry, T_UCHAR);
 #undef T
 #undef D
 #undef T_INT
@@ -1132,7 +1133,6 @@ _config_load(void)
    _elm_config->fps = 60.0;
    _elm_config->theme = eina_stringshare_add("default");
    _elm_config->modules = NULL;
-   _elm_config->is_mirrored = EINA_FALSE; /* Read sys value in env_get() */
    _elm_config->tooltip_delay = 1.0;
    _elm_config->cursor_engine_only = EINA_TRUE;
    _elm_config->focus_highlight_enable = EINA_FALSE;
@@ -1143,6 +1143,9 @@ _config_load(void)
    _elm_config->icon_size = 32;
    _elm_config->longpress_timeout = 1.0;
    _elm_config->effect_enable = EINA_TRUE;
+   _elm_config->desktop_entry = EINA_FALSE;
+
+   _elm_config->is_mirrored = EINA_FALSE; /* Read sys value in env_get() */
 }
 
 static const char *
@@ -1573,6 +1576,9 @@ _env_get(void)
    
    s = getenv("ELM_EFFECT_ENABLE");
    if (s) _elm_config->effect_enable = !!atoi(s);
+   
+   s = getenv("ELM_DESKTOP_ENTRY");
+   if (s) _elm_config->desktop_entry = !!atoi(s);
 }
 
 /**
index d94d3ef..1607db1 100644 (file)
@@ -543,6 +543,8 @@ _theme_hook(Evas_Object *obj)
 
    t = eina_stringshare_add(elm_entry_entry_get(obj));
    _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
+   if (_elm_config->desktop_entry)
+      edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
    elm_entry_entry_set(obj, t);
    eina_stringshare_del(t);
    if (elm_widget_disabled_get(obj))
@@ -755,8 +757,11 @@ _dismissed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
    if (wd->hoversel) evas_object_hide(wd->hoversel);
    if (wd->selmode)
      {
-        if (!wd->password)
-          edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
+        if (!_elm_config->desktop_entry)
+          {
+             if (!wd->password)
+                edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
+          }
      }
    elm_widget_scroll_freeze_pop(data);
    if (wd->hovdeljob) ecore_job_del(wd->hovdeljob);
@@ -770,10 +775,14 @@ _select(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
    if (!wd) return;
    wd->selmode = EINA_TRUE;
    edje_object_part_text_select_none(wd->ent, "elm.text");
-   if (!wd->password)
-     edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
+   if (!_elm_config->desktop_entry)
+     {
+        if (!wd->password)
+           edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
+     }
    edje_object_signal_emit(wd->ent, "elm,state,select,on", "elm");
-   elm_widget_scroll_hold_push(data);
+   if (!_elm_config->desktop_entry)
+      elm_widget_scroll_hold_push(data);
 }
 
 static void
@@ -815,9 +824,11 @@ _cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 
    /* Store it */
    wd->selmode = EINA_FALSE;
-   edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+   if (!_elm_config->desktop_entry)
+      edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
    edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
-   elm_widget_scroll_hold_pop(data);
+   if (!_elm_config->desktop_entry)
+      elm_widget_scroll_hold_pop(data);
    _store_selection(ELM_SEL_CLIPBOARD, data);
    edje_object_part_text_insert(wd->ent, "elm.text", "");
    edje_object_part_text_select_none(wd->ent, "elm.text");
@@ -829,9 +840,12 @@ _copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
    Widget_Data *wd = elm_widget_data_get(data);
    if (!wd) return;
    wd->selmode = EINA_FALSE;
-   edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
-   edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
-   elm_widget_scroll_hold_pop(data);
+   if (!_elm_config->desktop_entry)
+     {
+        edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+        edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
+        elm_widget_scroll_hold_pop(data);
+     }
    _store_selection(ELM_SEL_CLIPBOARD, data);
    //   edje_object_part_text_select_none(wd->ent, "elm.text");
 }
@@ -842,9 +856,11 @@ _cancel(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
    Widget_Data *wd = elm_widget_data_get(data);
    if (!wd) return;
    wd->selmode = EINA_FALSE;
-   edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+   if (!_elm_config->desktop_entry)
+      edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
    edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
-   elm_widget_scroll_hold_pop(data);
+   if (!_elm_config->desktop_entry)
+      elm_widget_scroll_hold_pop(data);
    edje_object_part_text_select_none(wd->ent, "elm.text");
 }
 
@@ -888,9 +904,12 @@ _menu_press(Evas_Object *obj)
         evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, obj);
         if (!wd->selmode)
           {
-             if (!wd->password)
-               elm_hoversel_item_add(wd->hoversel, E_("Select"), NULL, ELM_ICON_NONE,
-                                     _select, obj);
+             if (!_elm_config->desktop_entry)
+               {
+                  if (!wd->password)
+                     elm_hoversel_item_add(wd->hoversel, E_("Select"), NULL, ELM_ICON_NONE,
+                                           _select, obj);
+               }
              if (1) // need way to detect if someone has a selection
                {
                   if (wd->editable)
@@ -925,8 +944,11 @@ _menu_press(Evas_Object *obj)
              evas_object_show(wd->hoversel);
              elm_hoversel_hover_begin(wd->hoversel);
           }
-        edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
-        edje_object_part_text_select_abort(wd->ent, "elm.text");
+        if (!_elm_config->desktop_entry)
+          {
+             edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+             edje_object_part_text_select_abort(wd->ent, "elm.text");
+          }
      }
 }
 
@@ -1595,6 +1617,8 @@ elm_entry_add(Evas_Object *parent)
    edje_object_signal_callback_add(wd->ent, "mouse,down,1,double", "elm.text",
                                    _signal_mouse_double, obj);
    edje_object_part_text_set(wd->ent, "elm.text", "");
+   if (_elm_config->desktop_entry)
+      edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);
    elm_widget_resize_object_set(obj, wd->ent);
    _sizing_eval(obj);
 
@@ -1955,7 +1979,8 @@ elm_entry_select_none(Evas_Object *obj)
    if (wd->selmode)
      {
         wd->selmode = EINA_FALSE;
-        edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+        if (!_elm_config->desktop_entry)
+           edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
         edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
      }
    wd->have_selection = EINA_FALSE;
@@ -1978,7 +2003,8 @@ elm_entry_select_all(Evas_Object *obj)
    if (wd->selmode)
      {
         wd->selmode = EINA_FALSE;
-        edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
+        if (!_elm_config->desktop_entry)
+           edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_FALSE);
         edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
      }
    wd->have_selection = EINA_TRUE;
index e19a2c1..b88cab7 100644 (file)
@@ -76,45 +76,47 @@ extern const char *_elm_engines[];
 
 struct _Elm_Config
 {
-   int          config_version;
-   const char  *engine;
-   Eina_Bool    thumbscroll_enable;
-   int          thumbscroll_threshold;
-   double       thumbscroll_momentum_threshold;
-   double       thumbscroll_friction;
-   double       thumbscroll_bounce_friction;
-   double       page_scroll_friction;
-   double       bring_in_scroll_friction;
-   double       zoom_friction;
-   Eina_Bool    thumbscroll_bounce_enable;
-   double       thumbscroll_border_friction;
-   double       scale;
-   int          bgpixmap;
-   int          compositing;
-   Eina_List   *font_dirs;
-   Eina_List   *font_overlays;
-   int          font_hinting;
-   int          cache_flush_poll_interval;
-   Eina_Bool    cache_flush_enable;
-   int          image_cache;
-   int          font_cache;
-   int          edje_cache;
-   int          edje_collection_cache;
-   int          finger_size;
-   double       fps;
-   const char  *theme;
-   const char  *modules;
-   double       tooltip_delay;
-   Eina_Bool    cursor_engine_only;
-   Eina_Bool    focus_highlight_enable;
-   Eina_Bool    focus_highlight_animate;
-   int          toolbar_shrink_mode;
-   Eina_Bool    fileselector_expand_enable;
-   Eina_Bool    inwin_dialogs_enable;
-   int          icon_size;
-   double       longpress_timeout;
-   Eina_Bool    is_mirrored : 1;
-   Eina_Bool    effect_enable;
+   int            config_version;
+   const char    *engine;
+   unsigned char  thumbscroll_enable;
+   int            thumbscroll_threshold;
+   double         thumbscroll_momentum_threshold;
+   double         thumbscroll_friction;
+   double         thumbscroll_bounce_friction;
+   double         page_scroll_friction;
+   double         bring_in_scroll_friction;
+   double         zoom_friction;
+   unsigned char  thumbscroll_bounce_enable;
+   double         thumbscroll_border_friction;
+   double         scale;
+   int            bgpixmap;
+   int            compositing;
+   Eina_List     *font_dirs;
+   Eina_List     *font_overlays;
+   int            font_hinting;
+   int            cache_flush_poll_interval;
+   unsigned char  cache_flush_enable;
+   int            image_cache;
+   int            font_cache;
+   int            edje_cache;
+   int            edje_collection_cache;
+   int            finger_size;
+   double         fps;
+   const char    *theme;
+   const char    *modules;
+   double         tooltip_delay;
+   unsigned char  cursor_engine_only;
+   unsigned char  focus_highlight_enable;
+   unsigned char  focus_highlight_animate;
+   int            toolbar_shrink_mode;
+   unsigned char  fileselector_expand_enable;
+   unsigned char  inwin_dialogs_enable;
+   int            icon_size;
+   double         longpress_timeout;
+   unsigned char  effect_enable;
+   unsigned char  desktop_entry;
+
+   Eina_Bool      is_mirrored : 1;
 };
 
 struct _Elm_Module