diff --git a/mrklib.h b/mrklib.h index e167020..570ae58 100644 --- a/mrklib.h +++ b/mrklib.h @@ -107,6 +107,7 @@ struct _Mrk_Build { const char *name; const char *icon; + const char *splash; const char *brief; const char *version; const char *license; diff --git a/mrklib_buildfile.c b/mrklib_buildfile.c index 17d3977..2894d99 100644 --- a/mrklib_buildfile.c +++ b/mrklib_buildfile.c @@ -18,28 +18,29 @@ typedef struct static const Tag_Type tags[] = { - {"PROJ:", TMODE_EOL}, - {"PROJICON:", TMODE_PATH}, - {"BRIEF:", TMODE_TEXT}, - {"VERSION:", TMODE_EOL}, - {"LICENSE:", TMODE_EOL}, - {"COPYING:", TMODE_PATH_LIST}, - {"NEEDS:", TMODE_EOL}, - {"DOMAIN:", TMODE_PATH}, - {"REPO:", TMODE_EOL}, - {"DEVREPO:", TMODE_EOL}, - {"CONTACT:", TMODE_TEXT}, - {"CATEGORY:", TMODE_PATH_LIST}, - {"TAGS:", TMODE_PATH_LIST}, - {"BIN:", TMODE_PATH}, - {"SRC:", TMODE_PATH_LIST}, - {"DEPS:", TMODE_PATH_LIST}, - {"INC:", TMODE_PATH_LIST}, - {"DATA:", TMODE_PATH_CP_LIST}, - {"DESKTOP:", TMODE_PATH_LIST}, - {"ICON:", TMODE_PATH_LIST}, - {"PODOMAIN:", TMODE_PATH}, - {"PO:", TMODE_PATH_LIST}, + {"PROJ:", TMODE_EOL}, + {"PROJICON:", TMODE_PATH}, + {"PROJSPLASH", TMODE_PATH}, + {"BRIEF:", TMODE_TEXT}, + {"VERSION:", TMODE_EOL}, + {"LICENSE:", TMODE_EOL}, + {"COPYING:", TMODE_PATH_LIST}, + {"NEEDS:", TMODE_EOL}, + {"DOMAIN:", TMODE_PATH}, + {"REPO:", TMODE_EOL}, + {"DEVREPO:", TMODE_EOL}, + {"CONTACT:", TMODE_TEXT}, + {"CATEGORY:", TMODE_PATH_LIST}, + {"TAGS:", TMODE_PATH_LIST}, + {"BIN:", TMODE_PATH}, + {"SRC:", TMODE_PATH_LIST}, + {"DEPS:", TMODE_PATH_LIST}, + {"INC:", TMODE_PATH_LIST}, + {"DATA:", TMODE_PATH_CP_LIST}, + {"DESKTOP:", TMODE_PATH_LIST}, + {"ICON:", TMODE_PATH_LIST}, + {"PODOMAIN:", TMODE_PATH}, + {"PO:", TMODE_PATH_LIST}, {NULL, 0} // END OF LIST }; @@ -90,10 +91,17 @@ token: static char * path_check(char *tok) { - // XXX: check me + if (!_mrk_util_plain_path_check(tok)) return NULL; return strdup(tok); } +static Eina_List * +path_matches_append(Eina_List *list, const char *path) +{ + list = eina_list_append(list, eina_stringshare_add(path)); + return list; +} + static Mrk_Build * parse_content(char *mem, size_t size) { @@ -191,6 +199,11 @@ not_tag: eina_stringshare_del(bld->icon); bld->icon = eina_stringshare_add(data1); } + else if (!strcmp(seg, "PROJSPLASH:")) + { + eina_stringshare_del(bld->splash); + bld->splash = eina_stringshare_add(data1); + } else if (!strcmp(seg, "BRIEF:")) { if (!bld->brief) bld->brief = eina_stringshare_add(data1); @@ -282,10 +295,7 @@ not_tag: { Mrk_Build_Bin *build_bin = eina_list_data_get(eina_list_last(bld->bins)); if (build_bin) - { - build_bin->srcs = eina_list_append(build_bin->srcs, - eina_stringshare_add(data1)); - } + build_bin->srcs = path_matches_append(build_bin->srcs, data1); } else if (!strcmp(seg, "DEPS:")) { @@ -300,10 +310,7 @@ not_tag: { Mrk_Build_Bin *build_bin = eina_list_data_get(eina_list_last(bld->bins)); if (build_bin) - { - build_bin->incs = eina_list_append(build_bin->incs, - eina_stringshare_add(data1)); - } + build_bin->incs = path_matches_append(build_bin->incs, data1); } else if (!strcmp(seg, "DATA:")) { @@ -318,13 +325,11 @@ not_tag: } else if (!strcmp(seg, "DESKTOP:")) { - bld->desktops = eina_list_append(bld->desktops, - eina_stringshare_add(data1)); + bld->desktops = path_matches_append(bld->desktops, data1); } else if (!strcmp(seg, "ICON:")) { - bld->icons = eina_list_append(bld->icons, - eina_stringshare_add(data1)); + bld->icons = path_matches_append(bld->icons, data1); } else if (!strcmp(seg, "PO:")) { @@ -387,6 +392,7 @@ mrk_build_free(Mrk_Build *bld) if (!bld) return; eina_stringshare_del(bld->name); eina_stringshare_del(bld->icon); + eina_stringshare_del(bld->splash); eina_stringshare_del(bld->brief); eina_stringshare_del(bld->version); eina_stringshare_del(bld->license); @@ -765,6 +771,7 @@ mrk_build_package_bin(Mrk_Build *bld, const char *file, const char *tmpd, const if (var) eet_write(ef, key, var, strlen(var), EET_COMPRESSION_VERYFAST) WRTS("name", bld->name); if (bld->icon) package_file(ef, bld->icon, "icon"); + if (bld->splash) package_file(ef, bld->splash, "splash"); WRTS("brief", bld->brief); WRTS("version", bld->version); WRTS("license", bld->license); diff --git a/mrklib_package.c b/mrklib_package.c index 25154d4..00a4a28 100644 --- a/mrklib_package.c +++ b/mrklib_package.c @@ -247,6 +247,8 @@ mrk_package_bin_install(const char *file, const char *os, const char *arch) } snprintf(tmp, sizeof(tmp), "%s/Applications/%s/.icon.png", get_home(), name); write_file(ef, "icon", tmp); + snprintf(tmp, sizeof(tmp), "%s/Applications/%s/.splash.png", get_home(), name); + write_file(ef, "splash", tmp); snprintf(tmp, sizeof(tmp), "%s/Applications/%s/.info.mki", get_home(), name); ef2 = eet_open(tmp, EET_FILE_MODE_WRITE); free(name); diff --git a/mrklib_priv.h b/mrklib_priv.h index 8903e29..7c0095c 100644 --- a/mrklib_priv.h +++ b/mrklib_priv.h @@ -66,6 +66,16 @@ extern int _mrk_uuid_len; #define M_ID_VERSION 52 #define M_ID_ARCH 53 +#define M_INF_B 60 +#define M_INF_E 70 +#define M_INF_START 61 +#define M_INF_DATA 62 +#define M_INF_END 63 +#define M_INF_GET_IC 64 +#define M_INF_GET_SP 65 +#define M_INF_GET_IN 66 + + #if defined(__x86_64__) # define ARCH "x86_64" #elif defined(__i386__) diff --git a/mrklib_serv.c b/mrklib_serv.c index 99c62ae..69e191c 100644 --- a/mrklib_serv.c +++ b/mrklib_serv.c @@ -285,6 +285,34 @@ _mrk_query_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e) return EINA_FALSE; } +static Eina_Bool +_mrk_inf_data(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e) +{ + if ((!c->uuid) || (!c->version) || (!c->arch)) return EINA_FALSE; + if (e->minor == M_INF_GET_IC) + { + char *str = _mrk_util_proto_cli_string(e); + if (str) + { + if (_mrk_util_plain_file_check(str)) + { + char *str2 = malloc(strlen(str) + 1 + 8); + if (str2) + { + strcpy(str2, str); + strcat(str2, ".icn.png"); + client_send(c, "src", str2, + M_INF_START, M_INF_DATA, M_INF_END); + free(str2); + } + } + free(str); + } + return EINA_TRUE; + } + return EINA_FALSE; +} + static Eina_Bool _mrk_data_handle(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e) { @@ -294,6 +322,8 @@ _mrk_data_handle(Mrk_Serve *server, Client *c, Ecore_Ipc_Event_Client_Data *e) return _mrk_query_data(server, c, e); else if ((e->minor > M_ID_B) && (e->minor < M_ID_E)) return _mrk_id_data(server, c, e); + else if ((e->minor > M_INF_B) && (e->minor < M_INF_E)) + return _mrk_inf_data(server, c, e); return EINA_FALSE; }