" <arg type='i' name='h' direction='in' />"
" <arg type='i' name='result' direction='out' />"
" </method>"
+ " <method name='renew'>"
+ " <arg type='s' name='pkgname' direction='in' />"
+ " <arg type='s' name='filename' direction='in' />"
+ " <arg type='s' name='content' direction='in' />"
+ " <arg type='i' name='timeout' direction='in' />"
+ " <arg type='i' name='has_script' direction='in' />"
+ " <arg type='d' name='period' direction='in' />"
+ " <arg type='s' name='cluster' direction='in' />"
+ " <arg type='s' name='category' direction='in' />"
+ " <arg type='i' name='pinup' direction='in' />"
+ " <arg type='i' name='width' direction='in' />"
+ " <arg type='i' name='height' direction='in' />"
+ " <arg type='i' name='ret' direction='out' />"
+ " </method>"
" <method name='new'>"
" <arg type='s' name='pkgname' direction='in' />"
" <arg type='s' name='filename' direction='in' />"
livebox_resume_all();
}
+static void method_renew(GDBusMethodInvocation *inv, GVariant *param)
+{
+ const char *pkgname;
+ const char *filename;
+ const char *content;
+ const char *cluster;
+ const char *category;
+ int timeout;
+ int has_livebox_script;
+ double period;
+ int ret;
+ int w;
+ int h;
+ int lw;
+ int lh;
+ double priority;
+ int pinup;
+
+ g_variant_get(param, "(&s&s&siid&s&siii)", &pkgname, &filename,
+ &content, &timeout, &has_livebox_script,
+ &period, &cluster, &category, &pinup, &w, &h);
+
+ ret = livebox_create(pkgname, filename, content, timeout, has_livebox_script, period, cluster, category, &lw, &lh, &priority, pinup, 1);
+ if (ret == 0) {
+ if (lw != w || lh != h) {
+ int tmp;
+ tmp = livebox_resize(pkgname, filename, w, h);
+ /* Ignore return value */
+ DbgPrint("Resize returns %d\n", tmp);
+ }
+ }
+
+ param = g_variant_new("(i)", ret);
+ if (!param)
+ ErrPrint("Failed to create param\n");
+
+ g_dbus_method_invocation_return_value(inv, param);
+}
+
static void method_new(GDBusMethodInvocation *inv, GVariant *param)
{
const char *pkgname;
.method = method_resize,
},
{
+ .name = "renew",
+ .method = method_renew,
+ },
+ {
.name = "new",
.method = method_new,
},