summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Roberto de Souza <zehortigoza@profusion.mobi>2013-01-04 00:02:09 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2013-01-04 00:02:09 +0000
commit8114fff045b1bd5095ee5afc2531325503c6b470 (patch)
tree98b63bb977eb99f06631e79b5fd68cd8125cbb56
parent4cc1b0a8b26f756ccab5ba71fa9f78d1668f4f3f (diff)
ethumb: Fix edbus message construction
Also rename EDBus_Message_Iter* config to entry Patch by: José Roberto de Souza <zehortigoza@profusion.mobi> SVN revision: 82131
-rw-r--r--legacy/ethumb/src/lib/client/ethumb_client.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/legacy/ethumb/src/lib/client/ethumb_client.c b/legacy/ethumb/src/lib/client/ethumb_client.c
index aee2900..ad7f083 100644
--- a/legacy/ethumb/src/lib/client/ethumb_client.c
+++ b/legacy/ethumb/src/lib/client/ethumb_client.c
@@ -670,22 +670,22 @@ _ethumb_client_dbus_append_bytearray(EDBus_Message_Iter *parent, const char *str
670 */ 670 */
671 671
672static EDBus_Message_Iter * 672static EDBus_Message_Iter *
673_setup_iterator_open(EDBus_Message_Iter *array, EDBus_Message_Iter **config, const char *key, const char *type) 673_setup_iterator_open(EDBus_Message_Iter *array, EDBus_Message_Iter **entry, const char *key, const char *type)
674{ 674{
675 EDBus_Message_Iter *variant, *_struct; 675 EDBus_Message_Iter *variant, *_struct;
676 edbus_message_iter_arguments_append(array, "{sv}", &_struct); 676 edbus_message_iter_arguments_append(array, "{sv}", &_struct);
677 edbus_message_iter_basic_append(_struct, 's', key); 677 edbus_message_iter_basic_append(_struct, 's', key);
678 variant = edbus_message_iter_container_new(_struct, 'v', type); 678 variant = edbus_message_iter_container_new(_struct, 'v', type);
679 679
680 *config = _struct; 680 *entry = _struct;
681 return variant; 681 return variant;
682} 682}
683 683
684static void 684static void
685_setup_iterator_close(EDBus_Message_Iter *array, EDBus_Message_Iter *config, EDBus_Message_Iter *variant) 685_setup_iterator_close(EDBus_Message_Iter *array, EDBus_Message_Iter *entry, EDBus_Message_Iter *variant)
686{ 686{
687 edbus_message_iter_container_close(config, variant); 687 edbus_message_iter_container_close(entry, variant);
688 edbus_message_iter_container_close(array, config); 688 edbus_message_iter_container_close(array, entry);
689} 689}
690 690
691/** 691/**
@@ -701,11 +701,10 @@ EAPI void
701ethumb_client_ethumb_setup(Ethumb_Client *client) 701ethumb_client_ethumb_setup(Ethumb_Client *client)
702{ 702{
703 EDBus_Message *msg; 703 EDBus_Message *msg;
704 EDBus_Message_Iter *array, *main; 704 EDBus_Message_Iter *array, *main_iter;
705 EDBus_Message_Iter *config, *variant; 705 EDBus_Message_Iter *entry, *variant;
706 EDBus_Message_Iter *sub_struct; 706 EDBus_Message_Iter *sub_struct;
707 Ethumb *e = client->ethumb; 707 Ethumb *e = client->ethumb;
708 const char *entry;
709 int tw, th, format, aspect, orientation, quality, compress; 708 int tw, th, format, aspect, orientation, quality, compress;
710 float cx, cy; 709 float cx, cy;
711 double t; 710 double t;
@@ -718,98 +717,99 @@ ethumb_client_ethumb_setup(Ethumb_Client *client)
718 EINA_SAFETY_ON_FALSE_RETURN(client->connected); 717 EINA_SAFETY_ON_FALSE_RETURN(client->connected);
719 718
720 msg = edbus_proxy_method_call_new(client->proxy, "ethumb_setup"); 719 msg = edbus_proxy_method_call_new(client->proxy, "ethumb_setup");
721 main = edbus_message_iter_get(msg); 720 main_iter = edbus_message_iter_get(msg);
722 edbus_message_iter_arguments_append(main, "a{sv}", &array); 721 edbus_message_iter_arguments_append(main_iter, "a{sv}", &array);
723 722
724 /* starting array elements */ 723 /* starting array elements */
725 variant = _setup_iterator_open(array, &config, "size", "(ii)"); 724 variant = _setup_iterator_open(array, &entry, "size", "(ii)");
726 edbus_message_iter_arguments_append(variant, "(ii)", &sub_struct); 725 edbus_message_iter_arguments_append(variant, "(ii)", &sub_struct);
727 ethumb_thumb_size_get(e, &tw, &th); 726 ethumb_thumb_size_get(e, &tw, &th);
728 edbus_message_iter_arguments_append(sub_struct, "ii", tw, th); 727 edbus_message_iter_arguments_append(sub_struct, "ii", tw, th);
729 edbus_message_iter_container_close(sub_struct, variant); 728 edbus_message_iter_container_close(variant, sub_struct);
730 _setup_iterator_close(array, config, variant); 729 _setup_iterator_close(array, entry, variant);
731 730
732 variant = _setup_iterator_open(array, &config, "format", "i"); 731 variant = _setup_iterator_open(array, &entry, "format", "i");
733 format = ethumb_thumb_format_get(e); 732 format = ethumb_thumb_format_get(e);
734 edbus_message_iter_arguments_append(variant, "i", format); 733 edbus_message_iter_arguments_append(variant, "i", format);
735 _setup_iterator_close(array, config, variant); 734 _setup_iterator_close(array, entry, variant);
736 735
737 variant = _setup_iterator_open(array, &config, "aspect", "i"); 736 variant = _setup_iterator_open(array, &entry, "aspect", "i");
738 aspect = ethumb_thumb_aspect_get(e); 737 aspect = ethumb_thumb_aspect_get(e);
739 edbus_message_iter_arguments_append(variant, "i", aspect); 738 edbus_message_iter_arguments_append(variant, "i", aspect);
740 _setup_iterator_close(array, config, variant); 739 _setup_iterator_close(array, entry, variant);
741 740
742 variant = _setup_iterator_open(array, &config, "orientation", "i"); 741 variant = _setup_iterator_open(array, &entry, "orientation", "i");
743 orientation = ethumb_thumb_orientation_get(e); 742 orientation = ethumb_thumb_orientation_get(e);
744 edbus_message_iter_arguments_append(variant, "i", orientation); 743 edbus_message_iter_arguments_append(variant, "i", orientation);
745 _setup_iterator_close(array, config, variant); 744 _setup_iterator_close(array, entry, variant);
746 745
747 variant = _setup_iterator_open(array, &config, "crop", "(dd)"); 746 variant = _setup_iterator_open(array, &entry, "crop", "(dd)");
748 edbus_message_iter_arguments_append(variant, "(dd)", &sub_struct); 747 edbus_message_iter_arguments_append(variant, "(dd)", &sub_struct);
749 ethumb_thumb_crop_align_get(e, &cx, &cy); 748 ethumb_thumb_crop_align_get(e, &cx, &cy);
750 edbus_message_iter_arguments_append(sub_struct, "dd", (double)cx, (double)cy); 749 edbus_message_iter_arguments_append(sub_struct, "dd", (double)cx, (double)cy);
751 edbus_message_iter_container_close(sub_struct, variant); 750 edbus_message_iter_container_close(variant, sub_struct);
752 _setup_iterator_close(array, config, variant); 751 _setup_iterator_close(array, entry, variant);
753 752
754 variant = _setup_iterator_open(array, &config, "quality", "i"); 753 variant = _setup_iterator_open(array, &entry, "quality", "i");
755 quality = ethumb_thumb_quality_get(e); 754 quality = ethumb_thumb_quality_get(e);
756 edbus_message_iter_arguments_append(variant, "i", quality); 755 edbus_message_iter_arguments_append(variant, "i", quality);
757 _setup_iterator_close(array, config, variant); 756 _setup_iterator_close(array, entry, variant);
758 757
759 variant = _setup_iterator_open(array, &config, "compress", "i"); 758 variant = _setup_iterator_open(array, &entry, "compress", "i");
760 quality = ethumb_thumb_quality_get(e); 759 quality = ethumb_thumb_quality_get(e);
761 edbus_message_iter_arguments_append(variant, "i", compress); 760 edbus_message_iter_arguments_append(variant, "i", compress);
762 _setup_iterator_close(array, config, variant); 761 _setup_iterator_close(array, entry, variant);
763 762
764 variant = _setup_iterator_open(array, &config, "frame", "(ayayay)"); 763 variant = _setup_iterator_open(array, &entry, "frame", "(ayayay)");
765 edbus_message_iter_arguments_append(variant, "(ayayay)", &sub_struct); 764 edbus_message_iter_arguments_append(variant, "(ayayay)", &sub_struct);
766 ethumb_frame_get(e, &theme_file, &group, &swallow); 765 ethumb_frame_get(e, &theme_file, &group, &swallow);
767 _ethumb_client_dbus_append_bytearray(sub_struct, theme_file); 766 _ethumb_client_dbus_append_bytearray(sub_struct, theme_file);
768 _ethumb_client_dbus_append_bytearray(sub_struct, group); 767 _ethumb_client_dbus_append_bytearray(sub_struct, group);
769 _ethumb_client_dbus_append_bytearray(sub_struct, swallow); 768 _ethumb_client_dbus_append_bytearray(sub_struct, swallow);
770 _setup_iterator_close(array, config, variant); 769 edbus_message_iter_container_close(variant, sub_struct);
770 _setup_iterator_close(array, entry, variant);
771 771
772 variant = _setup_iterator_open(array, &config, "directory", "ay"); 772 variant = _setup_iterator_open(array, &entry, "directory", "ay");
773 directory = ethumb_thumb_dir_path_get(e); 773 directory = ethumb_thumb_dir_path_get(e);
774 _ethumb_client_dbus_append_bytearray(variant, directory); 774 _ethumb_client_dbus_append_bytearray(variant, directory);
775 _setup_iterator_close(array, config, variant); 775 _setup_iterator_close(array, entry, variant);
776 776
777 variant = _setup_iterator_open(array, &config, "category", "ay"); 777 variant = _setup_iterator_open(array, &entry, "category", "ay");
778 category = ethumb_thumb_category_get(e); 778 category = ethumb_thumb_category_get(e);
779 _ethumb_client_dbus_append_bytearray(variant, category); 779 _ethumb_client_dbus_append_bytearray(variant, category);
780 _setup_iterator_close(array, config, variant); 780 _setup_iterator_close(array, entry, variant);
781 781
782 variant = _setup_iterator_open(array, &config, "video_time", "d"); 782 variant = _setup_iterator_open(array, &entry, "video_time", "d");
783 video_time = ethumb_video_time_get(e); 783 video_time = ethumb_video_time_get(e);
784 edbus_message_iter_arguments_append(variant, "d", video_time); 784 edbus_message_iter_arguments_append(variant, "d", video_time);
785 _setup_iterator_close(array, config, variant); 785 _setup_iterator_close(array, entry, variant);
786 786
787 variant = _setup_iterator_open(array, &config, "video_start", "d"); 787 variant = _setup_iterator_open(array, &entry, "video_start", "d");
788 video_start = ethumb_video_start_get(e); 788 video_start = ethumb_video_start_get(e);
789 edbus_message_iter_arguments_append(variant, "d", video_start); 789 edbus_message_iter_arguments_append(variant, "d", video_start);
790 _setup_iterator_close(array, config, variant); 790 _setup_iterator_close(array, entry, variant);
791 791
792 variant = _setup_iterator_open(array, &config, "video_interval", "d"); 792 variant = _setup_iterator_open(array, &entry, "video_interval", "d");
793 video_interval = ethumb_video_interval_get(e); 793 video_interval = ethumb_video_interval_get(e);
794 edbus_message_iter_arguments_append(variant, "d", video_interval); 794 edbus_message_iter_arguments_append(variant, "d", video_interval);
795 _setup_iterator_close(array, config, variant); 795 _setup_iterator_close(array, entry, variant);
796 796
797 variant = _setup_iterator_open(array, &config, "video_ntimes", "u"); 797 variant = _setup_iterator_open(array, &entry, "video_ntimes", "u");
798 video_ntimes = ethumb_video_ntimes_get(e); 798 video_ntimes = ethumb_video_ntimes_get(e);
799 edbus_message_iter_arguments_append(variant, "u", video_ntimes); 799 edbus_message_iter_arguments_append(variant, "u", video_ntimes);
800 _setup_iterator_close(array, config, variant); 800 _setup_iterator_close(array, entry, variant);
801 801
802 variant = _setup_iterator_open(array, &config, "video_fps", "u"); 802 variant = _setup_iterator_open(array, &entry, "video_fps", "u");
803 video_fps = ethumb_video_fps_get(e); 803 video_fps = ethumb_video_fps_get(e);
804 edbus_message_iter_arguments_append(variant, "u", video_fps); 804 edbus_message_iter_arguments_append(variant, "u", video_fps);
805 _setup_iterator_close(array, config, variant); 805 _setup_iterator_close(array, entry, variant);
806 806
807 variant = _setup_iterator_open(array, &config, "document_page", "u"); 807 variant = _setup_iterator_open(array, &entry, "document_page", "u");
808 document_page = ethumb_document_page_get(e); 808 document_page = ethumb_document_page_get(e);
809 edbus_message_iter_arguments_append(variant, "u", document_page); 809 edbus_message_iter_arguments_append(variant, "u", document_page);
810 _setup_iterator_close(array, config, variant); 810 _setup_iterator_close(array, entry, variant);
811 811
812 edbus_message_iter_container_close(main, array); 812 edbus_message_iter_container_close(main_iter, array);
813 813
814 edbus_proxy_send(client->proxy, msg, _ethumb_client_ethumb_setup_cb, 814 edbus_proxy_send(client->proxy, msg, _ethumb_client_ethumb_setup_cb,
815 client, -1); 815 client, -1);