- snprintf(buf, BUFMAX, "Name=%s\n", mfx->package);
- fwrite(buf, 1, strlen(buf), file);
- }
-*/
-
-
- snprintf(buf, BUFMAX, "Type=Application\n");
- fwrite(buf, 1, strlen(buf), file);
-
- if(mfx->uiapplication->exec) {
- snprintf(buf, BUFMAX, "Exec=%s\n", mfx->uiapplication->exec);
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->icon && mfx->uiapplication->icon->text) {
- snprintf(buf, BUFMAX, "Icon=%s\n", mfx->uiapplication->icon->text);
- fwrite(buf, 1, strlen(buf), file);
- } else if(mfx->icon && mfx->icon->text) {
- snprintf(buf, BUFMAX, "Icon=%s\n", mfx->icon->text);
- fwrite(buf, 1, strlen(buf), file);
- }
-
- // MIME types
- if(mfx->uiapplication && mfx->uiapplication->appsvc) {
- appsvc_x *asvc = mfx->uiapplication->appsvc;
- mime_x *mi = NULL;
- const char *mime = NULL;
- const char *mime_delim = "; ";
- int mime_count = 0;
-
- strncpy(buf, "MimeType=", BUFMAX-1);
- while (asvc) {
- mi = asvc->mime;
- while (mi) {
- mime_count++;
- mime = mi->name;
- DBG("MIME type: %s\n", mime);
- strncat(buf, mime, BUFMAX-strlen(buf)-1);
- if(mi->next) {
- strncat(buf, mime_delim, BUFMAX-strlen(buf)-1);
- }
-
- mi = mi->next;
- mime = NULL;
- }
- asvc = asvc->next;
- }
- DBG("MIME types: buf[%s]\n", buf);
- DBG("MIME count: %d\n", mime_count);
- if(mime_count)
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->version) {
- snprintf(buf, BUFMAX, "Version=%s\n", mfx->version);
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->nodisplay) {
- snprintf(buf, BUFMAX, "NoDisplay=%s\n", mfx->uiapplication->nodisplay);
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->categories) {
- snprintf(buf, BUFMAX, "Categories=%s\n", mfx->uiapplication->categories);
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->taskmanage && !strcasecmp(mfx->uiapplication->taskmanage, "False")) {
- snprintf(buf, BUFMAX, "X-TIZEN-TaskManage=False\n");
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->enabled && !strcasecmp(mfx->uiapplication->enabled, "False")) {
- snprintf(buf, BUFMAX, "X-TIZEN-Enabled=False\n");
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->hwacceleration) {
- snprintf(buf, BUFMAX, "Hw-Acceleration=%s\n", mfx->uiapplication->hwacceleration);
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->multiple && !strcasecmp(mfx->uiapplication->multiple, "True")) {
- snprintf(buf, BUFMAX, "X-TIZEN-Multiple=True\n");
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->extraid) {
- snprintf(buf, BUFMAX, "X-TIZEN-PackageID=%s\n", mfx->uiapplication->extraid);
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->removable && !strcasecmp(mfx->removable, "False")) {
- snprintf(buf, BUFMAX, "X-TIZEN-Removable=False\n");
- fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->type) {
- snprintf(buf, BUFMAX, "X-TIZEN-PackageType=%s\n", mfx->type);
- fwrite(buf, 1, strlen(buf), file);
- }
-
- snprintf(buf, BUFMAX, "X-TIZEN-PkgID=%s\n", mfx->package);
- fwrite(buf, 1, strlen(buf), file);
-
-
-// snprintf(buf, BUFMAX, "X-TIZEN-PackageType=rpm\n");
-// fwrite(buf, 1, strlen(buf), file);
-
-
- if(mfx->uiapplication->appsvc) {
- snprintf(buf, BUFMAX, "X-TIZEN-Svc=");
- DBG("buf[%s]\n", buf);
-
-
- uiapplication_x *up = mfx->uiapplication;
- appsvc_x *asvc = NULL;
- operation_x *op = NULL;
- mime_x *mi = NULL;
- uri_x *ui = NULL;
- subapp_x *sub = NULL;
- const char *operation = NULL;
- const char *mime = NULL;
- const char *uri = NULL;
- const char *subapp = NULL;
- int i = 0;
-
-
- asvc = up->appsvc;
- while(asvc != NULL) {
- op = asvc->operation;
- while(op != NULL) {
- if (op)
- operation = op->name;
- mi = asvc->mime;
-
- do
- {
- if (mi)
- mime = mi->name;
- sub = asvc->subapp;
- do
- {
- if (sub)
- subapp = sub->name;
- ui = asvc->uri;
- do
- {
- if (ui)
- uri = ui->name;
-
- if(i++ > 0) {
- strncpy(buftemp, buf, BUFMAX);
- snprintf(buf, BUFMAX, "%s;", buftemp);
- }
-
-
- strncpy(buftemp, buf, BUFMAX);
- snprintf(buf, BUFMAX, "%s%s|%s|%s|%s", buftemp, operation?operation:"NULL", uri?uri:"NULL", mime?mime:"NULL", subapp?subapp:"NULL");
- DBG("buf[%s]\n", buf);
-
- if (ui)
- ui = ui->next;
- uri = NULL;
- } while(ui != NULL);
- if (sub)
- sub = sub->next;
- subapp = NULL;
- }while(sub != NULL);
- if (mi)
- mi = mi->next;
- mime = NULL;
- }while(mi != NULL);
- if (op)
- op = op->next;
- operation = NULL;
- }
- asvc = asvc->next;
- }
-
-
- fwrite(buf, 1, strlen(buf), file);
-
-// strncpy(buftemp, buf, BUFMAX);
-// snprintf(buf, BUFMAX, "%s\n", buftemp);
-// fwrite(buf, 1, strlen(buf), file);
- }
-
- if(mfx->uiapplication->appcontrol) {
- snprintf(buf, BUFMAX, "X-TIZEN-Svc=");
- DBG("buf[%s]\n", buf);
-
- uiapplication_x *up = mfx->uiapplication;
- appcontrol_x *acontrol = NULL;
- operation_x *op = NULL;
- mime_x *mi = NULL;
- uri_x *ui = NULL;
- subapp_x *sub = NULL;
- const char *operation = NULL;
- const char *mime = NULL;
- const char *uri = NULL;
- const char *subapp = NULL;
- int i = 0;
-
- acontrol = up->appcontrol;
- while(acontrol != NULL) {
- op = acontrol->operation;
- while(op != NULL) {
- if (op)
- operation = op->name;
- mi = acontrol->mime;
-
- do
- {
- if (mi)
- mime = mi->name;
- sub = acontrol->subapp;
- do
- {
- if (sub)
- subapp = sub->name;
- ui = acontrol->uri;
- do
- {
- if (ui)
- uri = ui->name;
-
- if(i++ > 0) {
- strncpy(buftemp, buf, BUFMAX);
- snprintf(buf, BUFMAX, "%s;", buftemp);
- }
-
- strncpy(buftemp, buf, BUFMAX);
- snprintf(buf, BUFMAX, "%s%s|%s|%s|%s", buftemp, operation?operation:"NULL", uri?uri:"NULL", mime?mime:"NULL", subapp?subapp:"NULL");
- DBG("buf[%s]\n", buf);
-
- if (ui)
- ui = ui->next;
- uri = NULL;
- } while(ui != NULL);
- if (sub)
- sub = sub->next;
- subapp = NULL;
- }while(sub != NULL);
- if (mi)
- mi = mi->next;
- mime = NULL;
- }while(mi != NULL);
- if (op)
- op = op->next;
- operation = NULL;
- }
- acontrol = acontrol->next;
- }
-
-
- fwrite(buf, 1, strlen(buf), file);
-
-// strncpy(buftemp, buf, BUFMAX);
-// snprintf(buf, BUFMAX, "%s\n", buftemp);
-// fwrite(buf, 1, strlen(buf), file);