This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efm2.
View the commit online.
commit 11178c5ae65112213e993d73015f166e0767736b
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Thu Feb 15 21:31:46 2024 +0000
more work in glueing actions together wtih cleaning
---
src/backends/default/open.c | 51 +++++++++++++++++++++++++++++++++++++++++++++
src/efm/efm.c | 38 ++++++++++++++++++++++++++-------
src/efm/efm_back_end.c | 26 +++++++++++------------
src/efm/efm_dnd.c | 8 +++----
src/efm/efm_private.h | 10 ++++-----
src/efm/efm_util.c | 5 +++++
6 files changed, 108 insertions(+), 30 deletions(-)
diff --git a/src/backends/default/open.c b/src/backends/default/open.c
index 9950ad6..9437f5d 100644
--- a/src/backends/default/open.c
+++ b/src/backends/default/open.c
@@ -7,6 +7,7 @@
// itself at all and do everything via fs handlers for open, delete, rename
// copy, import, export etc.
#include "cmd.h"
+#include "eina_types.h"
#include "sha.h"
#include "meta.h"
#include <Ecore_File.h>
@@ -933,6 +934,33 @@ err:
cmd_strbuf_print_consume(strbuf);
}
+static Eina_Bool
+_path_in_mon_dir(const char *path)
+{
+ Eina_Bool res = EINA_FALSE;
+ const char *mondir;
+ char *filedir = ecore_file_dir_get(path);
+
+ if (!filedir) return res;
+ if (!mon) goto done;
+ mondir = ecore_file_monitor_path_get(mon);
+ if (!mondir) goto done;
+ if (!strcmp(mondir, filedir)) res = EINA_TRUE;
+ done:
+ free(filedir);
+ return res;
+}
+
+static void
+_handle_drop_paste(const char *over, const char *action, const char *path)
+{
+ if (over)
+ fprintf(stderr, "DROP over=[%s] action="" > [%s]\n", over, action, path);
+ else
+ fprintf(stderr, "DROP action="" > [%s]\n", action, path);
+ // XXX: decide what to do with file and tell frontend
+}
+
void
do_handle_cmd(Cmd *c)
{
@@ -1032,6 +1060,29 @@ do_handle_cmd(Cmd *c)
}
KEY_WALK_END
}
+ else if (!strcmp(c->command, "dnd-drop"))
+ {
+ // "over" key means dnd was on that dir
+ const char *over = cmd_key_find(c, "over");
+ const char *action = "" "action");
+
+ KEY_WALK_BEGIN
+ {
+ if (!strcmp(key, "path"))
+ {
+ if (!over)
+ {
+ if (!_path_in_mon_dir(data))
+ _handle_drop_paste(over, action, data);
+ }
+ else _handle_drop_paste(over, action, data);
+ }
+ }
+ KEY_WALK_END
+ }
+ else if (!strcmp(c->command, "cnp-paste"))
+ {
+ }
// cmd_dump_sterr(c);
}
diff --git a/src/efm/efm.c b/src/efm/efm.c
index e6d03f4..9c7868a 100644
--- a/src/efm/efm.c
+++ b/src/efm/efm.c
@@ -127,6 +127,29 @@ _cb_sel_get(void *data, Evas_Object *_obj EINA_UNUSED, Elm_Selection_Data *ev)
}
free(*plist);
free(plist);
+ switch (ev->action)
+ { // reality is we will not get an action in the selection
+ case ELM_XDND_ACTION_COPY:
+ cmd_strbuf_append(buf, "action", "copy");
+ break;
+ case ELM_XDND_ACTION_MOVE:
+ cmd_strbuf_append(buf, "action", "move");
+ break;
+ case ELM_XDND_ACTION_ASK:
+ cmd_strbuf_append(buf, "action", "ask");
+ break;
+ case ELM_XDND_ACTION_LIST:
+ cmd_strbuf_append(buf, "action", "list");
+ break;
+ case ELM_XDND_ACTION_LINK:
+ cmd_strbuf_append(buf, "action", "link");
+ break;
+ case ELM_XDND_ACTION_DESCRIPTION:
+ cmd_strbuf_append(buf, "action", "description");
+ break;
+ default:
+ break;
+ }
if (buf)
{
_uri_list_cmd_strbuf_append(buf, "path", tmp);
@@ -153,7 +176,6 @@ _cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
Evas_Event_Key_Down *ev = event_info;
Eina_Bool handled = EINA_FALSE;
- printf("key: [%s]\n", ev->key);
// these keys we use/steal for navigation, so want them for sure
if (!strcmp(ev->key, "Up")) handled = _icon_focus_dir(sd, EFM_FOCUS_DIR_UP);
else if (!strcmp(ev->key, "Down"))
@@ -306,7 +328,7 @@ _cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
sd->key_control = EINA_TRUE;
}
- printf("KEY: [%c] [%s]\n", handled ? '#' : ' ', ev->key);
+ printf("XXX: KEY: [%c] [%s]\n", handled ? '#' : ' ', ev->key);
}
static void
@@ -316,16 +338,16 @@ _cb_refocus(void *data)
sd->refocus_job = NULL;
if (sd->rename_icon) return;
- printf("REFOCUS\n");
+// printf("XXX: REFOCUS\n");
if (sd->focused)
{
- printf(" focus widget\n");
+// printf("XXX: focus widget\n");
evas_object_focus_set(sd->o_clip, EINA_TRUE);
if (sd->key_control) _icon_focus_show(sd);
}
else
{
- printf(" unfocused widget\n");
+// printf("XXX: unfocused widget\n");
_icon_focus_hide(sd);
// XXX: exit rename mode if on...
}
@@ -337,7 +359,7 @@ _cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
{
Smart_Data *sd = data;
- printf("FOCUS OUT CLIP\n");
+// printf("XXX: FOCUS OUT CLIP\n");
if (sd->refocus_job) ecore_job_del(sd->refocus_job);
sd->refocus_job = ecore_job_add(_cb_refocus, sd);
}
@@ -1219,7 +1241,7 @@ _recalc(Smart_Data *sd)
static void
_listing_do(Smart_Data *sd)
{
- printf("ZZZ: LISTING DO -----------------------------------------\n");
+ printf("XXX: LISTING DO -----------------------------------------\n");
sd->listing_done = EINA_FALSE;
if (sd->config.view_mode == EFM_VIEW_MODE_ICONS_CUSTOM)
{
@@ -1230,7 +1252,7 @@ _listing_do(Smart_Data *sd)
void
_listing_done(Smart_Data *sd)
{
- printf("ZZZ: LISTING DONE -----------------------------------------\n");
+ printf("XXX: LISTING DONE -----------------------------------------\n");
sd->listing_done = EINA_TRUE;
if (sd->config.view_mode == EFM_VIEW_MODE_ICONS_CUSTOM)
{
diff --git a/src/efm/efm_back_end.c b/src/efm/efm_back_end.c
index 660f974..56ec21a 100644
--- a/src/efm/efm_back_end.c
+++ b/src/efm/efm_back_end.c
@@ -501,7 +501,7 @@ _cb_thread_notify(void *data, Ecore_Thread *th EINA_UNUSED, void *msg)
CMD_DONE;
}
else if (!strcmp(c->command, "viewmode-set"))
- { // *** must call before list-begin
+ { // must call before list-begin
const char *mode = cmd_key_find(c, "mode");
if (mode)
@@ -512,21 +512,21 @@ _cb_thread_notify(void *data, Ecore_Thread *th EINA_UNUSED, void *msg)
view_mode = EFM_VIEW_MODE_ICONS;
else if (!strcmp(mode, "icons_custom"))
view_mode = EFM_VIEW_MODE_ICONS_CUSTOM;
- else if (!strcmp(mode, "list"))
+ else if (!strcmp(mode, "list"))
view_mode = EFM_VIEW_MODE_LIST;
- else if (!strcmp(mode, "list_detailed"))
+ else if (!strcmp(mode, "list_detailed"))
view_mode = EFM_VIEW_MODE_LIST_DETAILED;
- if (view_mode != sd->config.view_mode)
- {
- int i;
+ if (view_mode != sd->config.view_mode)
+ {
+ int i;
- sd->config.view_mode = view_mode;
- for (i = 0; i < 6; i++)
- {
- if (sd->config.view_mode == EFM_VIEW_MODE_LIST_DETAILED)
- evas_object_show(sd->o_list_detail[i]);
- else evas_object_hide(sd->o_list_detail[i]);
- }
+ sd->config.view_mode = view_mode;
+ for (i = 0; i < 6; i++)
+ {
+ if (sd->config.view_mode == EFM_VIEW_MODE_LIST_DETAILED)
+ evas_object_show(sd->o_list_detail[i]);
+ else evas_object_hide(sd->o_list_detail[i]);
+ }
if (sd->header_change_job)
ecore_job_del(sd->header_change_job);
sd->header_change_job = ecore_job_add(_cb_header_change, sd);
diff --git a/src/efm/efm_dnd.c b/src/efm/efm_dnd.c
index b4fe894..bafcd2d 100644
--- a/src/efm/efm_dnd.c
+++ b/src/efm/efm_dnd.c
@@ -140,7 +140,7 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED, Elm_Selection_Data *ev)
Eina_Strbuf *buf = cmd_strbuf_new("dnd-drop");
switch (ev->action)
- {
+ {
case ELM_XDND_ACTION_COPY:
cmd_strbuf_append(buf, "action", "copy");
break;
@@ -161,7 +161,7 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED, Elm_Selection_Data *ev)
break;
default:
break;
- }
+ }
if (sd->drop_over)
{
@@ -190,7 +190,7 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED, Elm_Selection_Data *ev)
{
if ((icon->sd == sd) && (icon->drag))
{
- printf(" dropicon is %s%s\n", icon->sd->config.path,
+ printf("XXX: dropicon is %s%s\n", icon->sd->config.path,
icon->info.file);
delta_x = icon->sd->dnd_x - icon->down_rel_x - icon->geom.x;
delta_y = icon->sd->dnd_y - icon->down_rel_y - icon->geom.y;
@@ -220,7 +220,7 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED, Elm_Selection_Data *ev)
{
char str[128];
- if ((icon->sd == sd) /*(icon->drag)*/)
+ if (icon->sd == sd)
{
icon->geom.x += delta_x;
icon->geom.y += delta_y;
diff --git a/src/efm/efm_private.h b/src/efm/efm_private.h
index 645613e..4dab44f 100644
--- a/src/efm/efm_private.h
+++ b/src/efm/efm_private.h
@@ -2,6 +2,7 @@
#define EFM_PRIVATE_H 1
#include <Elementary.h>
+#include "efm_structs.h"
#define INVALID -999999
#define SCROLL_SEL_TIMER 0.2
@@ -15,12 +16,11 @@
Smart_Data *sd = evas_object_smart_data_get(obj); \
if (!sd) return
-void _listing_done(Smart_Data *sd);
-void _cb_header_change(void *data);
-void _reset(Smart_Data *sd);
-void _redo_detail_sizes(Smart_Data *sd);
+void _listing_done(Smart_Data *sd);
+void _cb_header_change(void *data);
+void _reset(Smart_Data *sd);
+void _redo_detail_sizes(Smart_Data *sd);
char *_sanitize_dir(const char *path);
-void _cb_header_change(void *data);
extern Eina_List *_efm_list;
extern Eina_List *_pending_exe_dels;
diff --git a/src/efm/efm_util.c b/src/efm/efm_util.c
index 4c861fc..b5b82dd 100644
--- a/src/efm/efm_util.c
+++ b/src/efm/efm_util.c
@@ -345,6 +345,11 @@ _icon_focus(Smart_Data *sd)
iw = sd->last_focused->geom.w;
ih = sd->last_focused->geom.h;
}
+ else
+ {
+ evas_object_hide(sd->o_focus);
+ return;
+ }
evas_object_geometry_set(sd->o_focus, sd->geom.x + ix, sd->geom.y + iy,
iw, ih);
edje_object_signal_emit(sd->o_focus, "elm,action,focus,show", "elm");
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.