summaryrefslogtreecommitdiff
path: root/legacy/ethumb/src/bin/ethumbd.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2009-07-17 14:44:11 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2009-07-17 14:44:11 +0000
commit6aa85b1cf9fb35012a4d732c1cb3eb283cff7de7 (patch)
tree219e862c6ca04920c9f4f1d8d18a3301fcf613ab /legacy/ethumb/src/bin/ethumbd.c
parentdf0ea7a123ce43b9e3bb079de9b97f68419c2ab4 (diff)
indent.
SVN revision: 41397
Diffstat (limited to '')
-rw-r--r--legacy/ethumb/src/bin/ethumbd.c258
1 files changed, 128 insertions, 130 deletions
diff --git a/legacy/ethumb/src/bin/ethumbd.c b/legacy/ethumb/src/bin/ethumbd.c
index c1f97d2d05..03d5e3fd2a 100644
--- a/legacy/ethumb/src/bin/ethumbd.c
+++ b/legacy/ethumb/src/bin/ethumbd.c
@@ -58,24 +58,24 @@ static const char fdo_path[] = "/org/freedesktop/DBus";
58struct _Ethumb_Setup 58struct _Ethumb_Setup
59{ 59{
60 struct 60 struct
61 { 61 {
62 Eina_Bool fdo : 1; 62 Eina_Bool fdo : 1;
63 Eina_Bool size : 1; 63 Eina_Bool size : 1;
64 Eina_Bool format : 1; 64 Eina_Bool format : 1;
65 Eina_Bool aspect : 1; 65 Eina_Bool aspect : 1;
66 Eina_Bool crop : 1; 66 Eina_Bool crop : 1;
67 Eina_Bool quality : 1; 67 Eina_Bool quality : 1;
68 Eina_Bool compress : 1; 68 Eina_Bool compress : 1;
69 Eina_Bool directory : 1; 69 Eina_Bool directory : 1;
70 Eina_Bool category : 1; 70 Eina_Bool category : 1;
71 Eina_Bool frame : 1; 71 Eina_Bool frame : 1;
72 Eina_Bool video_time : 1; 72 Eina_Bool video_time : 1;
73 Eina_Bool video_start : 1; 73 Eina_Bool video_start : 1;
74 Eina_Bool video_interval : 1; 74 Eina_Bool video_interval : 1;
75 Eina_Bool video_ntimes : 1; 75 Eina_Bool video_ntimes : 1;
76 Eina_Bool video_fps : 1; 76 Eina_Bool video_fps : 1;
77 Eina_Bool document_page : 1; 77 Eina_Bool document_page : 1;
78 } flags; 78 } flags;
79 int fdo; 79 int fdo;
80 int tw, th; 80 int tw, th;
81 int format; 81 int format;
@@ -171,18 +171,18 @@ const Ecore_Getopt optdesc = {
171 "(C) 2009 - ProFUSION embedded systems", 171 "(C) 2009 - ProFUSION embedded systems",
172 "LGPL v3 - GNU Lesser General Public License", 172 "LGPL v3 - GNU Lesser General Public License",
173 "Ethumb daemon.\n" 173 "Ethumb daemon.\n"
174 "\n" 174 "\n"
175 "ethumbd uses the Ethumb library to create thumbnails for any " 175 "ethumbd uses the Ethumb library to create thumbnails for any "
176 "program that requests it (now just by dbus).\n", 176 "program that requests it (now just by dbus).\n",
177 0, 177 0,
178 { 178 {
179 ECORE_GETOPT_STORE_DOUBLE 179 ECORE_GETOPT_STORE_DOUBLE
180 ('t', "timeout", "finish ethumbd after <timeout> seconds of no activity."), 180 ('t', "timeout", "finish ethumbd after <timeout> seconds of no activity."),
181 ECORE_GETOPT_LICENSE('L', "license"), 181 ECORE_GETOPT_LICENSE('L', "license"),
182 ECORE_GETOPT_COPYRIGHT('C', "copyright"), 182 ECORE_GETOPT_COPYRIGHT('C', "copyright"),
183 ECORE_GETOPT_VERSION('V', "version"), 183 ECORE_GETOPT_VERSION('V', "version"),
184 ECORE_GETOPT_HELP('h', "help"), 184 ECORE_GETOPT_HELP('h', "help"),
185 ECORE_GETOPT_SENTINEL 185 ECORE_GETOPT_SENTINEL
186 } 186 }
187}; 187};
188 188
@@ -423,8 +423,8 @@ _generated_cb(struct _Ethumbd *ed, Eina_Bool success, const char *thumb_path, co
423 DBG("thumbnail ready at: \"%s:%s\"\n", thumb_path, thumb_key); 423 DBG("thumbnail ready at: \"%s:%s\"\n", thumb_path, thumb_key);
424 424
425 if (ed->queue.table[i].used) 425 if (ed->queue.table[i].used)
426 _ethumb_dbus_generated_signal(ed, &ed->processing->id, thumb_path, 426 _ethumb_dbus_generated_signal
427 thumb_key, success); 427 (ed, &ed->processing->id, thumb_path, thumb_key, success);
428 eina_stringshare_del(ed->processing->file); 428 eina_stringshare_del(ed->processing->file);
429 eina_stringshare_del(ed->processing->key); 429 eina_stringshare_del(ed->processing->key);
430 eina_stringshare_del(ed->processing->thumb); 430 eina_stringshare_del(ed->processing->thumb);
@@ -584,9 +584,9 @@ _process_setup(struct _Ethumbd *ed)
584static void 584static void
585_process_file(struct _Ethumbd *ed) 585_process_file(struct _Ethumbd *ed)
586{ 586{
587 _ethumbd_child_write_op_generate(ed, ed->queue.current, ed->processing->file, 587 _ethumbd_child_write_op_generate
588 ed->processing->key, ed->processing->thumb, 588 (ed, ed->queue.current, ed->processing->file,
589 ed->processing->thumb_key); 589 ed->processing->key, ed->processing->thumb, ed->processing->thumb_key);
590} 590}
591 591
592static int 592static int
@@ -641,7 +641,7 @@ _process_queue_cb(void *data)
641 eobject->queue = eina_list_remove_list(eobject->queue, eobject->queue); 641 eobject->queue = eina_list_remove_list(eobject->queue, eobject->queue);
642 ed->queue.current = i; 642 ed->queue.current = i;
643 DBG("processing file: \"%s:%s\"...\n", request->file, 643 DBG("processing file: \"%s:%s\"...\n", request->file,
644 request->key); 644 request->key);
645 ed->processing = request; 645 ed->processing = request;
646 646
647 if (request->id < 0) 647 if (request->id < 0)
@@ -795,13 +795,13 @@ _name_owner_changed_cb(void *data, DBusMessage *msg)
795 795
796 dbus_error_init(&err); 796 dbus_error_init(&err);
797 if (!dbus_message_get_args(msg, &err, 797 if (!dbus_message_get_args(msg, &err,
798 DBUS_TYPE_STRING, &name, 798 DBUS_TYPE_STRING, &name,
799 DBUS_TYPE_STRING, &from, 799 DBUS_TYPE_STRING, &from,
800 DBUS_TYPE_STRING, &to, 800 DBUS_TYPE_STRING, &to,
801 DBUS_TYPE_INVALID)) 801 DBUS_TYPE_INVALID))
802 { 802 {
803 ERR("could not get NameOwnerChanged arguments: %s: %s\n", 803 ERR("could not get NameOwnerChanged arguments: %s: %s\n",
804 err.name, err.message); 804 err.name, err.message);
805 dbus_error_free(&err); 805 dbus_error_free(&err);
806 return; 806 return;
807 } 807 }
@@ -825,8 +825,8 @@ _name_owner_changed_cb(void *data, DBusMessage *msg)
825static void 825static void
826_ethumb_dbus_add_name_owner_changed_cb(struct _Ethumbd *ed) 826_ethumb_dbus_add_name_owner_changed_cb(struct _Ethumbd *ed)
827{ 827{
828 ed->name_owner_changed_handler = e_dbus_signal_handler_add( 828 ed->name_owner_changed_handler = e_dbus_signal_handler_add
829 ed->conn, fdo_bus_name, fdo_path, fdo_interface, "NameOwnerChanged", 829 (ed->conn, fdo_bus_name, fdo_path, fdo_interface, "NameOwnerChanged",
830 _name_owner_changed_cb, ed); 830 _name_owner_changed_cb, ed);
831} 831}
832 832
@@ -871,7 +871,7 @@ _ethumb_dbus_ethumb_new_cb(E_DBus_Object *object, DBusMessage *msg)
871 _ethumbd_child_write_op_new(ed, i); 871 _ethumbd_child_write_op_new(ed, i);
872 _ethumbd_timeout_stop(ed); 872 _ethumbd_timeout_stop(ed);
873 873
874end_new: 874 end_new:
875 reply = dbus_message_new_method_return(msg); 875 reply = dbus_message_new_method_return(msg);
876 dbus_message_iter_init_append(reply, &iter); 876 dbus_message_iter_init_append(reply, &iter);
877 dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH, 877 dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
@@ -880,10 +880,10 @@ end_new:
880} 880}
881 881
882static struct _Ethumb_DBus_Method_Table _ethumb_dbus_methods[] = 882static struct _Ethumb_DBus_Method_Table _ethumb_dbus_methods[] =
883{ 883 {
884 { "new", "", "o", _ethumb_dbus_ethumb_new_cb }, 884 {"new", "", "o", _ethumb_dbus_ethumb_new_cb},
885 { } 885 {NULL, NULL, NULL, NULL}
886}; 886 };
887 887
888static const char * 888static const char *
889_ethumb_dbus_get_bytearray(DBusMessageIter *iter) 889_ethumb_dbus_get_bytearray(DBusMessageIter *iter)
@@ -918,8 +918,8 @@ _ethumb_dbus_append_bytearray(DBusMessageIter *iter, const char *string)
918 string = ""; 918 string = "";
919 919
920 dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "y", &viter); 920 dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "y", &viter);
921 dbus_message_iter_append_fixed_array(&viter, DBUS_TYPE_BYTE, &string, 921 dbus_message_iter_append_fixed_array
922 strlen(string) + 1); 922 (&viter, DBUS_TYPE_BYTE, &string, strlen(string) + 1);
923 dbus_message_iter_close_container(iter, &viter); 923 dbus_message_iter_close_container(iter, &viter);
924} 924}
925 925
@@ -977,7 +977,7 @@ _ethumb_dbus_queue_add_cb(E_DBus_Object *object, DBusMessage *msg)
977 977
978 _process_queue_start(ed); 978 _process_queue_start(ed);
979 979
980end: 980 end:
981 reply = dbus_message_new_method_return(msg); 981 reply = dbus_message_new_method_return(msg);
982 dbus_message_iter_init_append(reply, &iter); 982 dbus_message_iter_init_append(reply, &iter);
983 dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &id); 983 dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &id);
@@ -1032,7 +1032,7 @@ _ethumb_dbus_queue_remove_cb(E_DBus_Object *object, DBusMessage *msg)
1032 _ethumb_dbus_inc_min_id(eobject); 1032 _ethumb_dbus_inc_min_id(eobject);
1033 } 1033 }
1034 1034
1035end: 1035 end:
1036 reply = dbus_message_new_method_return(msg); 1036 reply = dbus_message_new_method_return(msg);
1037 dbus_message_iter_init_append(reply, &iter); 1037 dbus_message_iter_init_append(reply, &iter);
1038 dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &r); 1038 dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &r);
@@ -1071,7 +1071,7 @@ _ethumb_dbus_queue_clear_cb(E_DBus_Object *object, DBusMessage *msg)
1071 ed->queue.nqueue -= eobject->nqueue; 1071 ed->queue.nqueue -= eobject->nqueue;
1072 eobject->nqueue = 0; 1072 eobject->nqueue = 0;
1073 1073
1074end: 1074 end:
1075 reply = dbus_message_new_method_return(msg); 1075 reply = dbus_message_new_method_return(msg);
1076 return reply; 1076 return reply;
1077} 1077}
@@ -1101,7 +1101,7 @@ _ethumb_dbus_delete_cb(E_DBus_Object *object, DBusMessage *msg)
1101} 1101}
1102 1102
1103static int 1103static int
1104_ethumb_dbus_fdo_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1104_ethumb_dbus_fdo_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request __UNUSED__)
1105{ 1105{
1106 int type; 1106 int type;
1107 dbus_int32_t fdo; 1107 dbus_int32_t fdo;
@@ -1120,7 +1120,7 @@ _ethumb_dbus_fdo_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, stru
1120} 1120}
1121 1121
1122static int 1122static int
1123_ethumb_dbus_size_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1123_ethumb_dbus_size_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1124{ 1124{
1125 DBusMessageIter oiter; 1125 DBusMessageIter oiter;
1126 int type; 1126 int type;
@@ -1146,7 +1146,7 @@ _ethumb_dbus_size_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, str
1146} 1146}
1147 1147
1148static int 1148static int
1149_ethumb_dbus_format_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1149_ethumb_dbus_format_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1150{ 1150{
1151 int type; 1151 int type;
1152 dbus_int32_t format; 1152 dbus_int32_t format;
@@ -1167,7 +1167,7 @@ _ethumb_dbus_format_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, s
1167} 1167}
1168 1168
1169static int 1169static int
1170_ethumb_dbus_aspect_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1170_ethumb_dbus_aspect_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1171{ 1171{
1172 int type; 1172 int type;
1173 dbus_int32_t aspect; 1173 dbus_int32_t aspect;
@@ -1188,7 +1188,7 @@ _ethumb_dbus_aspect_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, s
1188} 1188}
1189 1189
1190static int 1190static int
1191_ethumb_dbus_crop_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1191_ethumb_dbus_crop_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1192{ 1192{
1193 DBusMessageIter oiter; 1193 DBusMessageIter oiter;
1194 int type; 1194 int type;
@@ -1214,7 +1214,7 @@ _ethumb_dbus_crop_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, str
1214} 1214}
1215 1215
1216static int 1216static int
1217_ethumb_dbus_quality_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1217_ethumb_dbus_quality_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1218{ 1218{
1219 int type; 1219 int type;
1220 dbus_int32_t quality; 1220 dbus_int32_t quality;
@@ -1236,7 +1236,7 @@ _ethumb_dbus_quality_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter,
1236 1236
1237 1237
1238static int 1238static int
1239_ethumb_dbus_compress_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1239_ethumb_dbus_compress_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1240{ 1240{
1241 int type; 1241 int type;
1242 dbus_int32_t compress; 1242 dbus_int32_t compress;
@@ -1257,7 +1257,7 @@ _ethumb_dbus_compress_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter,
1257} 1257}
1258 1258
1259static int 1259static int
1260_ethumb_dbus_frame_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1260_ethumb_dbus_frame_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1261{ 1261{
1262 DBusMessageIter oiter; 1262 DBusMessageIter oiter;
1263 int type; 1263 int type;
@@ -1286,7 +1286,7 @@ _ethumb_dbus_frame_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, st
1286} 1286}
1287 1287
1288static int 1288static int
1289_ethumb_dbus_directory_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1289_ethumb_dbus_directory_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1290{ 1290{
1291 int type; 1291 int type;
1292 const char *directory; 1292 const char *directory;
@@ -1307,7 +1307,7 @@ _ethumb_dbus_directory_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter
1307} 1307}
1308 1308
1309static int 1309static int
1310_ethumb_dbus_category_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1310_ethumb_dbus_category_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1311{ 1311{
1312 int type; 1312 int type;
1313 const char *category; 1313 const char *category;
@@ -1328,7 +1328,7 @@ _ethumb_dbus_category_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter,
1328} 1328}
1329 1329
1330static int 1330static int
1331_ethumb_dbus_video_time_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1331_ethumb_dbus_video_time_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1332{ 1332{
1333 int type; 1333 int type;
1334 double video_time; 1334 double video_time;
@@ -1349,7 +1349,7 @@ _ethumb_dbus_video_time_set(struct _Ethumb_Object *eobject, DBusMessageIter *ite
1349} 1349}
1350 1350
1351static int 1351static int
1352_ethumb_dbus_video_start_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1352_ethumb_dbus_video_start_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1353{ 1353{
1354 int type; 1354 int type;
1355 double video_start; 1355 double video_start;
@@ -1370,7 +1370,7 @@ _ethumb_dbus_video_start_set(struct _Ethumb_Object *eobject, DBusMessageIter *it
1370} 1370}
1371 1371
1372static int 1372static int
1373_ethumb_dbus_video_interval_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1373_ethumb_dbus_video_interval_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1374{ 1374{
1375 int type; 1375 int type;
1376 double video_interval; 1376 double video_interval;
@@ -1391,7 +1391,7 @@ _ethumb_dbus_video_interval_set(struct _Ethumb_Object *eobject, DBusMessageIter
1391} 1391}
1392 1392
1393static int 1393static int
1394_ethumb_dbus_video_ntimes_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1394_ethumb_dbus_video_ntimes_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1395{ 1395{
1396 int type; 1396 int type;
1397 int video_ntimes; 1397 int video_ntimes;
@@ -1412,7 +1412,7 @@ _ethumb_dbus_video_ntimes_set(struct _Ethumb_Object *eobject, DBusMessageIter *i
1412} 1412}
1413 1413
1414static int 1414static int
1415_ethumb_dbus_video_fps_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1415_ethumb_dbus_video_fps_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1416{ 1416{
1417 int type; 1417 int type;
1418 int video_fps; 1418 int video_fps;
@@ -1433,7 +1433,7 @@ _ethumb_dbus_video_fps_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter
1433} 1433}
1434 1434
1435static int 1435static int
1436_ethumb_dbus_document_page_set(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request) 1436_ethumb_dbus_document_page_set(struct _Ethumb_Object *eobject __UNUSED__, DBusMessageIter *iter, struct _Ethumb_Request *request)
1437{ 1437{
1438 int type; 1438 int type;
1439 dbus_int32_t document_page; 1439 dbus_int32_t document_page;
@@ -1458,23 +1458,23 @@ static struct
1458 const char *option; 1458 const char *option;
1459 int (*setup_func)(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request); 1459 int (*setup_func)(struct _Ethumb_Object *eobject, DBusMessageIter *iter, struct _Ethumb_Request *request);
1460} _option_cbs[] = { 1460} _option_cbs[] = {
1461 { "fdo", _ethumb_dbus_fdo_set }, 1461 {"fdo", _ethumb_dbus_fdo_set},
1462 { "size", _ethumb_dbus_size_set }, 1462 {"size", _ethumb_dbus_size_set},
1463 { "format", _ethumb_dbus_format_set }, 1463 {"format", _ethumb_dbus_format_set},
1464 { "aspect", _ethumb_dbus_aspect_set }, 1464 {"aspect", _ethumb_dbus_aspect_set},
1465 { "crop", _ethumb_dbus_crop_set }, 1465 {"crop", _ethumb_dbus_crop_set},
1466 { "quality", _ethumb_dbus_quality_set }, 1466 {"quality", _ethumb_dbus_quality_set},
1467 { "compress", _ethumb_dbus_compress_set }, 1467 {"compress", _ethumb_dbus_compress_set},
1468 { "frame", _ethumb_dbus_frame_set }, 1468 {"frame", _ethumb_dbus_frame_set},
1469 { "directory", _ethumb_dbus_directory_set }, 1469 {"directory", _ethumb_dbus_directory_set},
1470 { "category", _ethumb_dbus_category_set }, 1470 {"category", _ethumb_dbus_category_set},
1471 { "video_time", _ethumb_dbus_video_time_set }, 1471 {"video_time", _ethumb_dbus_video_time_set},
1472 { "video_start", _ethumb_dbus_video_start_set }, 1472 {"video_start", _ethumb_dbus_video_start_set},
1473 { "video_interval", _ethumb_dbus_video_interval_set }, 1473 {"video_interval", _ethumb_dbus_video_interval_set},
1474 { "video_ntimes", _ethumb_dbus_video_ntimes_set }, 1474 {"video_ntimes", _ethumb_dbus_video_ntimes_set},
1475 { "video_fps", _ethumb_dbus_video_fps_set }, 1475 {"video_fps", _ethumb_dbus_video_fps_set},
1476 { "document_page", _ethumb_dbus_document_page_set }, 1476 {"document_page", _ethumb_dbus_document_page_set},
1477 { NULL, NULL} 1477 {NULL, NULL}
1478}; 1478};
1479 1479
1480static int 1480static int
@@ -1553,7 +1553,7 @@ _ethumb_dbus_ethumb_setup_cb(E_DBus_Object *object, DBusMessage *msg)
1553 eobject->nqueue++; 1553 eobject->nqueue++;
1554 ed->queue.nqueue++; 1554 ed->queue.nqueue++;
1555 1555
1556end: 1556 end:
1557 reply = dbus_message_new_method_return(msg); 1557 reply = dbus_message_new_method_return(msg);
1558 dbus_message_iter_init_append(reply, &iter); 1558 dbus_message_iter_init_append(reply, &iter);
1559 dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &r); 1559 dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &r);
@@ -1576,8 +1576,8 @@ _ethumb_dbus_generated_signal(struct _Ethumbd *ed, int *id, const char *thumb_pa
1576 1576
1577 current = ed->queue.current; 1577 current = ed->queue.current;
1578 opath = ed->queue.table[current].path; 1578 opath = ed->queue.table[current].path;
1579 signal = dbus_message_new_signal(opath, _ethumb_dbus_objects_interface, 1579 signal = dbus_message_new_signal
1580 "generated"); 1580 (opath, _ethumb_dbus_objects_interface, "generated");
1581 1581
1582 dbus_message_iter_init_append(signal, &iter); 1582 dbus_message_iter_init_append(signal, &iter);
1583 dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &id32); 1583 dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &id32);
@@ -1589,45 +1589,43 @@ _ethumb_dbus_generated_signal(struct _Ethumbd *ed, int *id, const char *thumb_pa
1589 dbus_message_unref(signal); 1589 dbus_message_unref(signal);
1590} 1590}
1591 1591
1592static struct _Ethumb_DBus_Method_Table _ethumb_dbus_objects_methods[] = 1592static struct _Ethumb_DBus_Method_Table _ethumb_dbus_objects_methods[] = {
1593{ 1593 {"queue_add", "iayayayay", "i", _ethumb_dbus_queue_add_cb},
1594 { "queue_add", "iayayayay", "i", _ethumb_dbus_queue_add_cb }, 1594 {"queue_remove", "i", "b", _ethumb_dbus_queue_remove_cb},
1595 { "queue_remove", "i", "b", _ethumb_dbus_queue_remove_cb }, 1595 {"clear_queue", "", "", _ethumb_dbus_queue_clear_cb},
1596 { "clear_queue", "", "", _ethumb_dbus_queue_clear_cb }, 1596 {"ethumb_setup", "a{sv}", "b", _ethumb_dbus_ethumb_setup_cb},
1597 { "ethumb_setup", "a{sv}", "b", _ethumb_dbus_ethumb_setup_cb }, 1597 {"delete", "", "", _ethumb_dbus_delete_cb},
1598 { "delete", "", "", _ethumb_dbus_delete_cb }, 1598 {NULL, NULL, NULL, NULL}
1599 { }
1600}; 1599};
1601 1600
1602static struct _Ethumb_DBus_Signal_Table _ethumb_dbus_objects_signals[] = 1601static struct _Ethumb_DBus_Signal_Table _ethumb_dbus_objects_signals[] = {
1603{ 1602 {"generated", "xayayb"},
1604 { "generated", "xayayb" }, 1603 {NULL, NULL}
1605 { }
1606}; 1604};
1607 1605
1608static int 1606static int
1609_ethumb_dbus_interface_elements_add(E_DBus_Interface *iface, struct _Ethumb_DBus_Method_Table *mtable, struct _Ethumb_DBus_Signal_Table *stable) 1607_ethumb_dbus_interface_elements_add(E_DBus_Interface *iface, struct _Ethumb_DBus_Method_Table *mtable, struct _Ethumb_DBus_Signal_Table *stable)
1610{ 1608{
1611 int i = -1; 1609 int i = -1;
1612 while (mtable && mtable[++i].name != NULL) 1610 while (mtable && mtable[++i].name != NULL)
1613 if (!e_dbus_interface_method_add(iface, 1611 if (!e_dbus_interface_method_add(iface,
1614 mtable[i].name, 1612 mtable[i].name,
1615 mtable[i].signature, 1613 mtable[i].signature,
1616 mtable[i].reply, 1614 mtable[i].reply,
1617 mtable[i].function)) 1615 mtable[i].function))
1618 return 0; 1616 return 0;
1619 1617
1620 i = -1; 1618 i = -1;
1621 while (stable && stable[++i].name != NULL) 1619 while (stable && stable[++i].name != NULL)
1622 if (!e_dbus_interface_signal_add(iface, 1620 if (!e_dbus_interface_signal_add(iface,
1623 stable[i].name, 1621 stable[i].name,
1624 stable[i].signature)) 1622 stable[i].signature))
1625 return 0; 1623 return 0;
1626 return 1; 1624 return 1;
1627} 1625}
1628 1626
1629static void 1627static void
1630_ethumb_dbus_request_name_cb(void *data, DBusMessage *msg, DBusError *err) 1628_ethumb_dbus_request_name_cb(void *data, DBusMessage *msg __UNUSED__, DBusError *err)
1631{ 1629{
1632 E_DBus_Object *dbus_object; 1630 E_DBus_Object *dbus_object;
1633 struct _Ethumbd *ed = data; 1631 struct _Ethumbd *ed = data;
@@ -1686,9 +1684,8 @@ _ethumb_dbus_request_name_cb(void *data, DBusMessage *msg, DBusError *err)
1686static int 1684static int
1687_ethumb_dbus_setup(struct _Ethumbd *ed) 1685_ethumb_dbus_setup(struct _Ethumbd *ed)
1688{ 1686{
1689 1687 e_dbus_request_name
1690 e_dbus_request_name(ed->conn, _ethumb_dbus_bus_name, 0, 1688 (ed->conn, _ethumb_dbus_bus_name, 0, _ethumb_dbus_request_name_cb, ed);
1691 _ethumb_dbus_request_name_cb, ed);
1692 1689
1693 return 1; 1690 return 1;
1694} 1691}
@@ -1745,8 +1742,8 @@ _ethumbd_spawn(struct _Ethumbd *ed)
1745 close(pchild[1]); 1742 close(pchild[1]);
1746 ed->pipeout = pparent[1]; 1743 ed->pipeout = pparent[1];
1747 ed->pipein = pchild[0]; 1744 ed->pipein = pchild[0];
1748 ed->fd_handler = ecore_main_fd_handler_add( 1745 ed->fd_handler = ecore_main_fd_handler_add
1749 ed->pipein, ECORE_FD_READ | ECORE_FD_ERROR, 1746 (ed->pipein, ECORE_FD_READ | ECORE_FD_ERROR,
1750 _ethumbd_fd_handler, ed, NULL, NULL); 1747 _ethumbd_fd_handler, ed, NULL, NULL);
1751 return 1; 1748 return 1;
1752 } 1749 }
@@ -1758,10 +1755,11 @@ main(int argc, char *argv[])
1758 Eina_Bool quit_option = 0; 1755 Eina_Bool quit_option = 0;
1759 int exit_value = 0; 1756 int exit_value = 0;
1760 int arg_index; 1757 int arg_index;
1761 struct _Ethumbd ed = {0}; 1758 struct _Ethumbd ed;
1762 int child; 1759 int child;
1763 double timeout = -1; 1760 double timeout = -1;
1764 1761
1762 memset(&ed, 0, sizeof(ed));
1765 ecore_init(); 1763 ecore_init();
1766 eina_stringshare_init(); 1764 eina_stringshare_init();
1767 1765
@@ -1788,12 +1786,12 @@ main(int argc, char *argv[])
1788 } 1786 }
1789 1787
1790 Ecore_Getopt_Value values[] = { 1788 Ecore_Getopt_Value values[] = {
1791 ECORE_GETOPT_VALUE_DOUBLE(timeout), 1789 ECORE_GETOPT_VALUE_DOUBLE(timeout),
1792 ECORE_GETOPT_VALUE_BOOL(quit_option), 1790 ECORE_GETOPT_VALUE_BOOL(quit_option),
1793 ECORE_GETOPT_VALUE_BOOL(quit_option), 1791 ECORE_GETOPT_VALUE_BOOL(quit_option),
1794 ECORE_GETOPT_VALUE_BOOL(quit_option), 1792 ECORE_GETOPT_VALUE_BOOL(quit_option),
1795 ECORE_GETOPT_VALUE_BOOL(quit_option), 1793 ECORE_GETOPT_VALUE_BOOL(quit_option),
1796 ECORE_GETOPT_VALUE_NONE 1794 ECORE_GETOPT_VALUE_NONE
1797 }; 1795 };
1798 1796
1799 arg_index = ecore_getopt_parse(&optdesc, values, argc, argv); 1797 arg_index = ecore_getopt_parse(&optdesc, values, argc, argv);
@@ -1828,9 +1826,9 @@ main(int argc, char *argv[])
1828 ecore_main_loop_begin(); 1826 ecore_main_loop_begin();
1829 _ethumb_dbus_finish(&ed); 1827 _ethumb_dbus_finish(&ed);
1830 1828
1831finish_edbus: 1829 finish_edbus:
1832 e_dbus_shutdown(); 1830 e_dbus_shutdown();
1833finish: 1831 finish:
1834 ethumb_shutdown(); 1832 ethumb_shutdown();
1835 eina_stringshare_init(); 1833 eina_stringshare_init();
1836 ecore_shutdown(); 1834 ecore_shutdown();