From: Enlightenment S. <no-...@en...> - 2009-11-17 14:16:34
|
Log: Add actual busycover code. Author: devilhorns Date: 2009-11-17 06:16:23 -0800 (Tue, 17 Nov 2009) New Revision: 43748 Added: trunk/e/src/modules/illume-home/e_busycover.c Modified: trunk/e/src/modules/illume-home/Makefile.am trunk/e/src/modules/illume-home/e_busycover.h trunk/e/src/modules/illume-home/e_mod_main.c Modified: trunk/e/src/modules/illume-home/Makefile.am =================================================================== --- trunk/e/src/modules/illume-home/Makefile.am 2009-11-17 12:36:12 UTC (rev 43747) +++ trunk/e/src/modules/illume-home/Makefile.am 2009-11-17 14:16:23 UTC (rev 43748) @@ -20,6 +20,7 @@ pkg_LTLIBRARIES = module.la module_la_SOURCES = e_mod_main.c \ e_mod_main.h \ + e_busycover.c \ e_busycover.h module_la_LIBADD = @e_libs@ @dlopen_libs@ Modified: trunk/e/src/modules/illume-home/e_busycover.h =================================================================== --- trunk/e/src/modules/illume-home/e_busycover.h 2009-11-17 12:36:12 UTC (rev 43747) +++ trunk/e/src/modules/illume-home/e_busycover.h 2009-11-17 14:16:23 UTC (rev 43748) @@ -12,6 +12,7 @@ E_Zone *zone; Evas_Object *o_base; Eina_List *handlers, *handles; + const char *themedir; }; struct _E_Busycover_Handle Modified: trunk/e/src/modules/illume-home/e_mod_main.c =================================================================== --- trunk/e/src/modules/illume-home/e_mod_main.c 2009-11-17 12:36:12 UTC (rev 43747) +++ trunk/e/src/modules/illume-home/e_mod_main.c 2009-11-17 14:16:23 UTC (rev 43748) @@ -1,5 +1,6 @@ #include "e.h" #include "e_mod_main.h" +#include "e_busycover.h" /* local structures */ typedef struct _Instance Instance; @@ -35,7 +36,8 @@ /* local variables */ static Eina_List *instances = NULL; -static E_Module *mod; +static E_Module *mod = NULL; +static E_Busycover *busycover = NULL; static const E_Gadcon_Client_Class _gc_class = { @@ -51,6 +53,13 @@ EAPI void * e_modapi_init(E_Module *m) { + E_Zone *zone; + + zone = e_util_container_zone_number_get(0, 0); + + e_busycover_init(); + busycover = e_busycover_new(zone, m->dir); + mod = m; e_gadcon_provider_register(&_gc_class); return m; @@ -61,6 +70,12 @@ { e_gadcon_provider_unregister(&_gc_class); mod = NULL; + if (busycover) + { + e_object_del(E_OBJECT(busycover)); + busycover = NULL; + } + e_busycover_shutdown(); return 1; } @@ -367,8 +382,77 @@ if (ici->real_link) { desktop = efreet_desktop_get(ici->real_link); -// if (desktop) _il_home_desktop_run(desktop); + if (desktop) _il_home_desktop_run(desktop); } + else printf("No Real Link: %s\n", ici->file); } } } + +static void +_il_home_desktop_run(Efreet_Desktop *desktop) +{ + Eina_List *l; + E_Border *bd; + E_Exec_Instance *eins; + char *exe = NULL, *p; + + if (!desktop) return; + if (!desktop->exec) return; + p = strchr(desktop->exec, ' '); + if (!p) + exe = strdup(desktop->exec); + else + { + exe = malloc(p - desktop->exec + 1); + if (exe) ecore_strlcpy(exe, desktop->exec, p - desktop->exec + 1); + } + if (exe) + { + p = strrchr(exe, '/'); + if (p) strcpy(exe, p + 1); + } + EINA_LIST_FOREACH(e_border_client_list(), l, bd) + { + if (e_exec_startup_id_pid_find(bd->client.netwm.pid, + bd->client.netwm.startup_id) == desktop) + { + e_border_show(bd); + if (exe) free(exe); + return; + } + if (exe) + { + if (bd->client.icccm.command.argv) + { + char *pp; + + pp = strrchr(bd->client.icccm.command.argv[0], '/'); + if (!pp) pp = bd->client.icccm.command.argv[0]; + if (!strcmp(exe, pp)) + { + e_border_show(bd); + if (exe) free(exe); + return; + } + } + if ((bd->client.icccm.name) && + (!strcasecmp(bd->client.icccm.name, exe))) + { + e_border_show(bd); + if (exe) free(exe); + return; + } + } + } + if (exe) free(exe); + eins = e_exec(e_util_container_zone_number_get(0, 0), + desktop, NULL, NULL, "illume-home"); + if (eins) + { + char buff[PATH_MAX]; + + snprintf(buff, sizeof(buff), "Starting %s", desktop->name); + e_busycover_push(busycover, buff, NULL); + } +} |